Skip to content

Resource: awsAppconfigEnvironment

Provides an AppConfig Environment resource for an awsAppconfigApplication resource. One or more environments can be defined for an application.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const awsAppconfigApplicationExample =
  new aws.appconfigApplication.AppconfigApplication(this, "example", {
    description: "Example AppConfig Application",
    name: "example-application-tf",
    tags: {
      Type: "AppConfig Application",
    },
  });
const awsAppconfigEnvironmentExample =
  new aws.appconfigEnvironment.AppconfigEnvironment(this, "example_1", {
    applicationId: awsAppconfigApplicationExample.id,
    description: "Example AppConfig Environment",
    monitor: [
      {
        alarmArn: "${aws_cloudwatch_metric_alarm.example.arn}",
        alarmRoleArn: "${aws_iam_role.example.arn}",
      },
    ],
    name: "example-environment-tf",
    tags: {
      Type: "AppConfig Environment",
    },
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsAppconfigEnvironmentExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • applicationId - (Required, Forces new resource) AppConfig application ID. Must be between 4 and 7 characters in length.
  • name - (Required) Name for the environment. Must be between 1 and 64 characters in length.
  • description - (Optional) Description of the environment. Can be at most 1024 characters.
  • monitor - (Optional) Set of Amazon CloudWatch alarms to monitor during the deployment process. Maximum of 5. See Monitor below for more details.
  • tags - (Optional) Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Monitor

The monitor block supports the following:

  • alarmArn - (Required) ARN of the Amazon CloudWatch alarm.
  • alarmRoleArn - (Optional) ARN of an IAM role for AWS AppConfig to monitor alarmArn.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • arn - ARN of the AppConfig Environment.
  • id - AppConfig environment ID and application ID separated by a colon (:).
  • environmentId - AppConfig environment ID.
  • state - State of the environment. Possible values are READY_FOR_DEPLOYMENT, deploying, ROLLING_BACK or ROLLED_BACK.
  • tagsAll - Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.

Import

AppConfig Environments can be imported by using the environment ID and application ID separated by a colon (:), e.g.,

$ terraform import aws_appconfig_environment.example 71abcde:11xxxxx