UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

252 lines • 11.3 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Environment = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Creates a MWAA Environment resource. * * ## Example Usage * * A MWAA Environment requires an IAM role (`aws.iam.Role`), two subnets in the private zone (`aws.ec2.Subnet`) and a versioned S3 bucket (`aws.s3.Bucket`). * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.mwaa.Environment("example", { * dagS3Path: "dags/", * executionRoleArn: exampleAwsIamRole.arn, * name: "example", * networkConfiguration: { * securityGroupIds: [exampleAwsSecurityGroup.id], * subnetIds: _private.map(__item => __item.id), * }, * sourceBucketArn: exampleAwsS3Bucket.arn, * }); * ``` * * ### Example with Airflow configuration options * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.mwaa.Environment("example", { * airflowConfigurationOptions: { * "core.default_task_retries": "16", * "core.parallelism": "1", * }, * dagS3Path: "dags/", * executionRoleArn: exampleAwsIamRole.arn, * name: "example", * networkConfiguration: { * securityGroupIds: [exampleAwsSecurityGroup.id], * subnetIds: _private.map(__item => __item.id), * }, * sourceBucketArn: exampleAwsS3Bucket.arn, * }); * ``` * * ### Example with logging configurations * * Note that Airflow task logs are enabled by default with the `INFO` log level. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.mwaa.Environment("example", { * dagS3Path: "dags/", * executionRoleArn: exampleAwsIamRole.arn, * loggingConfiguration: { * dagProcessingLogs: { * enabled: true, * logLevel: "DEBUG", * }, * schedulerLogs: { * enabled: true, * logLevel: "INFO", * }, * taskLogs: { * enabled: true, * logLevel: "WARNING", * }, * webserverLogs: { * enabled: true, * logLevel: "ERROR", * }, * workerLogs: { * enabled: true, * logLevel: "CRITICAL", * }, * }, * name: "example", * networkConfiguration: { * securityGroupIds: [exampleAwsSecurityGroup.id], * subnetIds: _private.map(__item => __item.id), * }, * sourceBucketArn: exampleAwsS3Bucket.arn, * }); * ``` * * ### Example with tags * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.mwaa.Environment("example", { * dagS3Path: "dags/", * executionRoleArn: exampleAwsIamRole.arn, * name: "example", * networkConfiguration: { * securityGroupIds: [exampleAwsSecurityGroup.id], * subnetIds: _private.map(__item => __item.id), * }, * sourceBucketArn: exampleAwsS3Bucket.arn, * tags: { * Name: "example", * Environment: "production", * }, * }); * ``` * * ## Import * * Using `pulumi import`, import MWAA Environment using `Name`. For example: * * ```sh * $ pulumi import aws:mwaa/environment:Environment example MyAirflowEnvironment * ``` */ class Environment extends pulumi.CustomResource { /** * Get an existing Environment resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new Environment(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Environment. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === Environment.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["airflowConfigurationOptions"] = state?.airflowConfigurationOptions; resourceInputs["airflowVersion"] = state?.airflowVersion; resourceInputs["arn"] = state?.arn; resourceInputs["createdAt"] = state?.createdAt; resourceInputs["dagS3Path"] = state?.dagS3Path; resourceInputs["databaseVpcEndpointService"] = state?.databaseVpcEndpointService; resourceInputs["endpointManagement"] = state?.endpointManagement; resourceInputs["environmentClass"] = state?.environmentClass; resourceInputs["executionRoleArn"] = state?.executionRoleArn; resourceInputs["kmsKey"] = state?.kmsKey; resourceInputs["lastUpdateds"] = state?.lastUpdateds; resourceInputs["loggingConfiguration"] = state?.loggingConfiguration; resourceInputs["maxWebservers"] = state?.maxWebservers; resourceInputs["maxWorkers"] = state?.maxWorkers; resourceInputs["minWebservers"] = state?.minWebservers; resourceInputs["minWorkers"] = state?.minWorkers; resourceInputs["name"] = state?.name; resourceInputs["networkConfiguration"] = state?.networkConfiguration; resourceInputs["pluginsS3ObjectVersion"] = state?.pluginsS3ObjectVersion; resourceInputs["pluginsS3Path"] = state?.pluginsS3Path; resourceInputs["region"] = state?.region; resourceInputs["requirementsS3ObjectVersion"] = state?.requirementsS3ObjectVersion; resourceInputs["requirementsS3Path"] = state?.requirementsS3Path; resourceInputs["schedulers"] = state?.schedulers; resourceInputs["serviceRoleArn"] = state?.serviceRoleArn; resourceInputs["sourceBucketArn"] = state?.sourceBucketArn; resourceInputs["startupScriptS3ObjectVersion"] = state?.startupScriptS3ObjectVersion; resourceInputs["startupScriptS3Path"] = state?.startupScriptS3Path; resourceInputs["status"] = state?.status; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["webserverAccessMode"] = state?.webserverAccessMode; resourceInputs["webserverUrl"] = state?.webserverUrl; resourceInputs["webserverVpcEndpointService"] = state?.webserverVpcEndpointService; resourceInputs["weeklyMaintenanceWindowStart"] = state?.weeklyMaintenanceWindowStart; resourceInputs["workerReplacementStrategy"] = state?.workerReplacementStrategy; } else { const args = argsOrState; if (args?.dagS3Path === undefined && !opts.urn) { throw new Error("Missing required property 'dagS3Path'"); } if (args?.executionRoleArn === undefined && !opts.urn) { throw new Error("Missing required property 'executionRoleArn'"); } if (args?.networkConfiguration === undefined && !opts.urn) { throw new Error("Missing required property 'networkConfiguration'"); } if (args?.sourceBucketArn === undefined && !opts.urn) { throw new Error("Missing required property 'sourceBucketArn'"); } resourceInputs["airflowConfigurationOptions"] = args?.airflowConfigurationOptions ? pulumi.secret(args.airflowConfigurationOptions) : undefined; resourceInputs["airflowVersion"] = args?.airflowVersion; resourceInputs["dagS3Path"] = args?.dagS3Path; resourceInputs["endpointManagement"] = args?.endpointManagement; resourceInputs["environmentClass"] = args?.environmentClass; resourceInputs["executionRoleArn"] = args?.executionRoleArn; resourceInputs["kmsKey"] = args?.kmsKey; resourceInputs["loggingConfiguration"] = args?.loggingConfiguration; resourceInputs["maxWebservers"] = args?.maxWebservers; resourceInputs["maxWorkers"] = args?.maxWorkers; resourceInputs["minWebservers"] = args?.minWebservers; resourceInputs["minWorkers"] = args?.minWorkers; resourceInputs["name"] = args?.name; resourceInputs["networkConfiguration"] = args?.networkConfiguration; resourceInputs["pluginsS3ObjectVersion"] = args?.pluginsS3ObjectVersion; resourceInputs["pluginsS3Path"] = args?.pluginsS3Path; resourceInputs["region"] = args?.region; resourceInputs["requirementsS3ObjectVersion"] = args?.requirementsS3ObjectVersion; resourceInputs["requirementsS3Path"] = args?.requirementsS3Path; resourceInputs["schedulers"] = args?.schedulers; resourceInputs["sourceBucketArn"] = args?.sourceBucketArn; resourceInputs["startupScriptS3ObjectVersion"] = args?.startupScriptS3ObjectVersion; resourceInputs["startupScriptS3Path"] = args?.startupScriptS3Path; resourceInputs["tags"] = args?.tags; resourceInputs["webserverAccessMode"] = args?.webserverAccessMode; resourceInputs["weeklyMaintenanceWindowStart"] = args?.weeklyMaintenanceWindowStart; resourceInputs["workerReplacementStrategy"] = args?.workerReplacementStrategy; resourceInputs["arn"] = undefined /*out*/; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["databaseVpcEndpointService"] = undefined /*out*/; resourceInputs["lastUpdateds"] = undefined /*out*/; resourceInputs["serviceRoleArn"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; resourceInputs["webserverUrl"] = undefined /*out*/; resourceInputs["webserverVpcEndpointService"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["airflowConfigurationOptions"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(Environment.__pulumiType, name, resourceInputs, opts); } } exports.Environment = Environment; /** @internal */ Environment.__pulumiType = 'aws:mwaa/environment:Environment'; //# sourceMappingURL=environment.js.map