UNPKG

@pulumi/aws

Version:

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

250 lines • 12.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, Object.assign(Object.assign({}, 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 ? state.airflowConfigurationOptions : undefined; resourceInputs["airflowVersion"] = state ? state.airflowVersion : undefined; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["dagS3Path"] = state ? state.dagS3Path : undefined; resourceInputs["databaseVpcEndpointService"] = state ? state.databaseVpcEndpointService : undefined; resourceInputs["endpointManagement"] = state ? state.endpointManagement : undefined; resourceInputs["environmentClass"] = state ? state.environmentClass : undefined; resourceInputs["executionRoleArn"] = state ? state.executionRoleArn : undefined; resourceInputs["kmsKey"] = state ? state.kmsKey : undefined; resourceInputs["lastUpdateds"] = state ? state.lastUpdateds : undefined; resourceInputs["loggingConfiguration"] = state ? state.loggingConfiguration : undefined; resourceInputs["maxWebservers"] = state ? state.maxWebservers : undefined; resourceInputs["maxWorkers"] = state ? state.maxWorkers : undefined; resourceInputs["minWebservers"] = state ? state.minWebservers : undefined; resourceInputs["minWorkers"] = state ? state.minWorkers : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["networkConfiguration"] = state ? state.networkConfiguration : undefined; resourceInputs["pluginsS3ObjectVersion"] = state ? state.pluginsS3ObjectVersion : undefined; resourceInputs["pluginsS3Path"] = state ? state.pluginsS3Path : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["requirementsS3ObjectVersion"] = state ? state.requirementsS3ObjectVersion : undefined; resourceInputs["requirementsS3Path"] = state ? state.requirementsS3Path : undefined; resourceInputs["schedulers"] = state ? state.schedulers : undefined; resourceInputs["serviceRoleArn"] = state ? state.serviceRoleArn : undefined; resourceInputs["sourceBucketArn"] = state ? state.sourceBucketArn : undefined; resourceInputs["startupScriptS3ObjectVersion"] = state ? state.startupScriptS3ObjectVersion : undefined; resourceInputs["startupScriptS3Path"] = state ? state.startupScriptS3Path : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; resourceInputs["webserverAccessMode"] = state ? state.webserverAccessMode : undefined; resourceInputs["webserverUrl"] = state ? state.webserverUrl : undefined; resourceInputs["webserverVpcEndpointService"] = state ? state.webserverVpcEndpointService : undefined; resourceInputs["weeklyMaintenanceWindowStart"] = state ? state.weeklyMaintenanceWindowStart : undefined; } else { const args = argsOrState; if ((!args || args.dagS3Path === undefined) && !opts.urn) { throw new Error("Missing required property 'dagS3Path'"); } if ((!args || args.executionRoleArn === undefined) && !opts.urn) { throw new Error("Missing required property 'executionRoleArn'"); } if ((!args || args.networkConfiguration === undefined) && !opts.urn) { throw new Error("Missing required property 'networkConfiguration'"); } if ((!args || args.sourceBucketArn === undefined) && !opts.urn) { throw new Error("Missing required property 'sourceBucketArn'"); } resourceInputs["airflowConfigurationOptions"] = (args === null || args === void 0 ? void 0 : args.airflowConfigurationOptions) ? pulumi.secret(args.airflowConfigurationOptions) : undefined; resourceInputs["airflowVersion"] = args ? args.airflowVersion : undefined; resourceInputs["dagS3Path"] = args ? args.dagS3Path : undefined; resourceInputs["endpointManagement"] = args ? args.endpointManagement : undefined; resourceInputs["environmentClass"] = args ? args.environmentClass : undefined; resourceInputs["executionRoleArn"] = args ? args.executionRoleArn : undefined; resourceInputs["kmsKey"] = args ? args.kmsKey : undefined; resourceInputs["loggingConfiguration"] = args ? args.loggingConfiguration : undefined; resourceInputs["maxWebservers"] = args ? args.maxWebservers : undefined; resourceInputs["maxWorkers"] = args ? args.maxWorkers : undefined; resourceInputs["minWebservers"] = args ? args.minWebservers : undefined; resourceInputs["minWorkers"] = args ? args.minWorkers : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["networkConfiguration"] = args ? args.networkConfiguration : undefined; resourceInputs["pluginsS3ObjectVersion"] = args ? args.pluginsS3ObjectVersion : undefined; resourceInputs["pluginsS3Path"] = args ? args.pluginsS3Path : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["requirementsS3ObjectVersion"] = args ? args.requirementsS3ObjectVersion : undefined; resourceInputs["requirementsS3Path"] = args ? args.requirementsS3Path : undefined; resourceInputs["schedulers"] = args ? args.schedulers : undefined; resourceInputs["sourceBucketArn"] = args ? args.sourceBucketArn : undefined; resourceInputs["startupScriptS3ObjectVersion"] = args ? args.startupScriptS3ObjectVersion : undefined; resourceInputs["startupScriptS3Path"] = args ? args.startupScriptS3Path : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["webserverAccessMode"] = args ? args.webserverAccessMode : undefined; resourceInputs["weeklyMaintenanceWindowStart"] = args ? args.weeklyMaintenanceWindowStart : undefined; 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