AWS::AppConfig::Environment
The AWS::AppConfig::Environment resource creates an environment, which is a
logical deployment group of Amazon AppConfig targets, such as applications in a
Beta or Production environment. You define one or more
environments for each Amazon AppConfig application. You can also define environments for
application subcomponents such as the Web, Mobile and
Back-end components for your application. You can configure Amazon CloudWatch alarms for each environment. The system monitors alarms during a
configuration deployment. If an alarm is triggered, the system rolls back the
configuration.
Amazon AppConfig requires that you create resources and deploy a configuration in the following order:
-
Create an application
-
Create an environment
-
Create a configuration profile
-
Create a deployment strategy
-
Deploy the configuration
For more information, see Amazon AppConfig in the Amazon AppConfig User Guide.
Syntax
To declare this entity in your Amazon CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::AppConfig::Environment", "Properties" : { "ApplicationId" :String, "Description" :String, "Monitors" :[ Monitors, ... ], "Name" :String, "Tags" :[ Tags, ... ]} }
YAML
Type: AWS::AppConfig::Environment Properties: ApplicationId:StringDescription:StringMonitors:- MonitorsName:StringTags:- Tags
Properties
ApplicationId-
The application ID.
Required: Yes
Type: String
Pattern:
[a-z0-9]{4,7}Update requires: Replacement
Description-
A description of the environment.
Required: No
Type: String
Minimum:
0Maximum:
1024Update requires: No interruption
Monitors-
Amazon CloudWatch alarms to monitor during the deployment process.
Required: No
Maximum:
5Update requires: No interruption
Name-
A name for the environment.
Required: Yes
Type: String
Minimum:
1Maximum:
64Update requires: No interruption
Tags-
Metadata to assign to the environment. Tags help organize and categorize your Amazon AppConfig resources. Each tag consists of a key and an optional value, both of which you define.
Required: No
Update requires: No interruption
Return values
Ref
When you pass the logical ID of this resource to the intrinsic Reffunction, Refreturns the environment ID.
Examples
Amazon AppConfig environment example
The following example creates an Amazon AppConfig environment named MyTestEnvironment. An environment is a logical deployment group of Amazon AppConfig targets, such as applications in a Beta or Production environment. You can also define environments for application subcomponents such as the Web, Mobile, and Back-end components for your application.
JSON
Resources": { "BasicEnvironment": { "Type": "AWS::AppConfig::Environment", "DependsOn": "DependentApplication", "Properties": { "ApplicationId": null, "Name": "MyTestEnvironment", "Description": "My test environment", "Tags": [ { "Key": "Env", "Value": "test" } ] } } } }
YAML
Resources: BasicEnvironment: Type: AWS::AppConfig::Environment Properties: ApplicationId: !Ref DependentApplication Name: "MyTestEnvironment" Description: "My test environment" Tags: - Key: Env Value: test