Environment

Provides an AppConfig Environment resource for an aws.appconfig.Application resource. One or more environments can be defined for an application.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var exampleApplication = new Aws.AppConfig.Application("exampleApplication", new()
    {
        Description = "Example AppConfig Application",
        Tags = 
        {
            { "Type", "AppConfig Application" },
        },
    });

    var exampleEnvironment = new Aws.AppConfig.Environment("exampleEnvironment", new()
    {
        Description = "Example AppConfig Environment",
        ApplicationId = exampleApplication.Id,
        Monitors = new[]
        {
            new Aws.AppConfig.Inputs.EnvironmentMonitorArgs
            {
                AlarmArn = aws_cloudwatch_metric_alarm.Example.Arn,
                AlarmRoleArn = aws_iam_role.Example.Arn,
            },
        },
        Tags = 
        {
            { "Type", "AppConfig Environment" },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/appconfig"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleApplication, err := appconfig.NewApplication(ctx, "exampleApplication", &appconfig.ApplicationArgs{
			Description: pulumi.String("Example AppConfig Application"),
			Tags: pulumi.StringMap{
				"Type": pulumi.String("AppConfig Application"),
			},
		})
		if err != nil {
			return err
		}
		_, err = appconfig.NewEnvironment(ctx, "exampleEnvironment", &appconfig.EnvironmentArgs{
			Description:   pulumi.String("Example AppConfig Environment"),
			ApplicationId: exampleApplication.ID(),
			Monitors: appconfig.EnvironmentMonitorArray{
				&appconfig.EnvironmentMonitorArgs{
					AlarmArn:     pulumi.Any(aws_cloudwatch_metric_alarm.Example.Arn),
					AlarmRoleArn: pulumi.Any(aws_iam_role.Example.Arn),
				},
			},
			Tags: pulumi.StringMap{
				"Type": pulumi.String("AppConfig Environment"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.appconfig.Application;
import com.pulumi.aws.appconfig.ApplicationArgs;
import com.pulumi.aws.appconfig.Environment;
import com.pulumi.aws.appconfig.EnvironmentArgs;
import com.pulumi.aws.appconfig.inputs.EnvironmentMonitorArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var exampleApplication = new Application("exampleApplication", ApplicationArgs.builder()        
            .description("Example AppConfig Application")
            .tags(Map.of("Type", "AppConfig Application"))
            .build());

        var exampleEnvironment = new Environment("exampleEnvironment", EnvironmentArgs.builder()        
            .description("Example AppConfig Environment")
            .applicationId(exampleApplication.id())
            .monitors(EnvironmentMonitorArgs.builder()
                .alarmArn(aws_cloudwatch_metric_alarm.example().arn())
                .alarmRoleArn(aws_iam_role.example().arn())
                .build())
            .tags(Map.of("Type", "AppConfig Environment"))
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example_application = aws.appconfig.Application("exampleApplication",
    description="Example AppConfig Application",
    tags={
        "Type": "AppConfig Application",
    })
example_environment = aws.appconfig.Environment("exampleEnvironment",
    description="Example AppConfig Environment",
    application_id=example_application.id,
    monitors=[aws.appconfig.EnvironmentMonitorArgs(
        alarm_arn=aws_cloudwatch_metric_alarm["example"]["arn"],
        alarm_role_arn=aws_iam_role["example"]["arn"],
    )],
    tags={
        "Type": "AppConfig Environment",
    })
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const exampleApplication = new aws.appconfig.Application("exampleApplication", {
    description: "Example AppConfig Application",
    tags: {
        Type: "AppConfig Application",
    },
});
const exampleEnvironment = new aws.appconfig.Environment("exampleEnvironment", {
    description: "Example AppConfig Environment",
    applicationId: exampleApplication.id,
    monitors: [{
        alarmArn: aws_cloudwatch_metric_alarm.example.arn,
        alarmRoleArn: aws_iam_role.example.arn,
    }],
    tags: {
        Type: "AppConfig Environment",
    },
});
resources:
  exampleEnvironment:
    type: aws:appconfig:Environment
    properties:
      description: Example AppConfig Environment
      applicationId: ${exampleApplication.id}
      monitors:
        - alarmArn: ${aws_cloudwatch_metric_alarm.example.arn}
          alarmRoleArn: ${aws_iam_role.example.arn}
      tags:
        Type: AppConfig Environment
  exampleApplication:
    type: aws:appconfig:Application
    properties:
      description: Example AppConfig Application
      tags:
        Type: AppConfig Application

Create Environment Resource

new Environment(name: string, args: EnvironmentArgs, opts?: CustomResourceOptions);
@overload
def Environment(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                application_id: Optional[str] = None,
                description: Optional[str] = None,
                monitors: Optional[Sequence[EnvironmentMonitorArgs]] = None,
                name: Optional[str] = None,
                tags: Optional[Mapping[str, str]] = None)
@overload
def Environment(resource_name: str,
                args: EnvironmentArgs,
                opts: Optional[ResourceOptions] = None)
func NewEnvironment(ctx *Context, name string, args EnvironmentArgs, opts ...ResourceOption) (*Environment, error)
public Environment(string name, EnvironmentArgs args, CustomResourceOptions? opts = null)
public Environment(String name, EnvironmentArgs args)
public Environment(String name, EnvironmentArgs args, CustomResourceOptions options)
type: aws:appconfig:Environment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args EnvironmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args EnvironmentArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args EnvironmentArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args EnvironmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args EnvironmentArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Environment Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Environment resource accepts the following input properties:

ApplicationId string

AppConfig application ID. Must be between 4 and 7 characters in length.

Description string

Description of the environment. Can be at most 1024 characters.

Monitors List<EnvironmentMonitorArgs>

Set of Amazon CloudWatch alarms to monitor during the deployment process. Maximum of 5. See Monitor below for more details.

Name string

Name for the environment. Must be between 1 and 64 characters in length.

Tags Dictionary<string, string>

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

ApplicationId string

AppConfig application ID. Must be between 4 and 7 characters in length.

Description string

Description of the environment. Can be at most 1024 characters.

Monitors []EnvironmentMonitorArgs

Set of Amazon CloudWatch alarms to monitor during the deployment process. Maximum of 5. See Monitor below for more details.

Name string

Name for the environment. Must be between 1 and 64 characters in length.

Tags map[string]string

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

applicationId String

AppConfig application ID. Must be between 4 and 7 characters in length.

description String

Description of the environment. Can be at most 1024 characters.

monitors List<EnvironmentMonitorArgs>

Set of Amazon CloudWatch alarms to monitor during the deployment process. Maximum of 5. See Monitor below for more details.

name String

Name for the environment. Must be between 1 and 64 characters in length.

tags Map<String,String>

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

applicationId string

AppConfig application ID. Must be between 4 and 7 characters in length.

description string

Description of the environment. Can be at most 1024 characters.

monitors EnvironmentMonitorArgs[]

Set of Amazon CloudWatch alarms to monitor during the deployment process. Maximum of 5. See Monitor below for more details.

name string

Name for the environment. Must be between 1 and 64 characters in length.

tags {[key: string]: string}

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

application_id str

AppConfig application ID. Must be between 4 and 7 characters in length.

description str

Description of the environment. Can be at most 1024 characters.

monitors Sequence[EnvironmentMonitorArgs]

Set of Amazon CloudWatch alarms to monitor during the deployment process. Maximum of 5. See Monitor below for more details.

name str

Name for the environment. Must be between 1 and 64 characters in length.

tags Mapping[str, str]

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

applicationId String

AppConfig application ID. Must be between 4 and 7 characters in length.

description String

Description of the environment. Can be at most 1024 characters.

monitors List<Property Map>

Set of Amazon CloudWatch alarms to monitor during the deployment process. Maximum of 5. See Monitor below for more details.

name String

Name for the environment. Must be between 1 and 64 characters in length.

tags Map<String>

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Outputs

All input properties are implicitly available as output properties. Additionally, the Environment resource produces the following output properties:

Arn string

ARN of the AppConfig Environment.

EnvironmentId string

AppConfig environment ID.

Id string

The provider-assigned unique ID for this managed resource.

State string

State of the environment. Possible values are READY_FOR_DEPLOYMENT, DEPLOYING, ROLLING_BACK or ROLLED_BACK.

TagsAll Dictionary<string, string>

Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Arn string

ARN of the AppConfig Environment.

EnvironmentId string

AppConfig environment ID.

Id string

The provider-assigned unique ID for this managed resource.

State string

State of the environment. Possible values are READY_FOR_DEPLOYMENT, DEPLOYING, ROLLING_BACK or ROLLED_BACK.

TagsAll map[string]string

Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

ARN of the AppConfig Environment.

environmentId String

AppConfig environment ID.

id String

The provider-assigned unique ID for this managed resource.

state String

State of the environment. Possible values are READY_FOR_DEPLOYMENT, DEPLOYING, ROLLING_BACK or ROLLED_BACK.

tagsAll Map<String,String>

Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn string

ARN of the AppConfig Environment.

environmentId string

AppConfig environment ID.

id string

The provider-assigned unique ID for this managed resource.

state string

State of the environment. Possible values are READY_FOR_DEPLOYMENT, DEPLOYING, ROLLING_BACK or ROLLED_BACK.

tagsAll {[key: string]: string}

Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn str

ARN of the AppConfig Environment.

environment_id str

AppConfig environment ID.

id str

The provider-assigned unique ID for this managed resource.

state str

State of the environment. Possible values are READY_FOR_DEPLOYMENT, DEPLOYING, ROLLING_BACK or ROLLED_BACK.

tags_all Mapping[str, str]

Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

ARN of the AppConfig Environment.

environmentId String

AppConfig environment ID.

id String

The provider-assigned unique ID for this managed resource.

state String

State of the environment. Possible values are READY_FOR_DEPLOYMENT, DEPLOYING, ROLLING_BACK or ROLLED_BACK.

tagsAll Map<String>

Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Look up Existing Environment Resource

Get an existing Environment resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: EnvironmentState, opts?: CustomResourceOptions): Environment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        application_id: Optional[str] = None,
        arn: Optional[str] = None,
        description: Optional[str] = None,
        environment_id: Optional[str] = None,
        monitors: Optional[Sequence[EnvironmentMonitorArgs]] = None,
        name: Optional[str] = None,
        state: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None) -> Environment
func GetEnvironment(ctx *Context, name string, id IDInput, state *EnvironmentState, opts ...ResourceOption) (*Environment, error)
public static Environment Get(string name, Input<string> id, EnvironmentState? state, CustomResourceOptions? opts = null)
public static Environment get(String name, Output<String> id, EnvironmentState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
ApplicationId string

AppConfig application ID. Must be between 4 and 7 characters in length.

Arn string

ARN of the AppConfig Environment.

Description string

Description of the environment. Can be at most 1024 characters.

EnvironmentId string

AppConfig environment ID.

Monitors List<EnvironmentMonitorArgs>

Set of Amazon CloudWatch alarms to monitor during the deployment process. Maximum of 5. See Monitor below for more details.

Name string

Name for the environment. Must be between 1 and 64 characters in length.

State string

State of the environment. Possible values are READY_FOR_DEPLOYMENT, DEPLOYING, ROLLING_BACK or ROLLED_BACK.

Tags Dictionary<string, string>

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

TagsAll Dictionary<string, string>

Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

ApplicationId string

AppConfig application ID. Must be between 4 and 7 characters in length.

Arn string

ARN of the AppConfig Environment.

Description string

Description of the environment. Can be at most 1024 characters.

EnvironmentId string

AppConfig environment ID.

Monitors []EnvironmentMonitorArgs

Set of Amazon CloudWatch alarms to monitor during the deployment process. Maximum of 5. See Monitor below for more details.

Name string

Name for the environment. Must be between 1 and 64 characters in length.

State string

State of the environment. Possible values are READY_FOR_DEPLOYMENT, DEPLOYING, ROLLING_BACK or ROLLED_BACK.

Tags map[string]string

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

TagsAll map[string]string

Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

applicationId String

AppConfig application ID. Must be between 4 and 7 characters in length.

arn String

ARN of the AppConfig Environment.

description String

Description of the environment. Can be at most 1024 characters.

environmentId String

AppConfig environment ID.

monitors List<EnvironmentMonitorArgs>

Set of Amazon CloudWatch alarms to monitor during the deployment process. Maximum of 5. See Monitor below for more details.

name String

Name for the environment. Must be between 1 and 64 characters in length.

state String

State of the environment. Possible values are READY_FOR_DEPLOYMENT, DEPLOYING, ROLLING_BACK or ROLLED_BACK.

tags Map<String,String>

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll Map<String,String>

Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

applicationId string

AppConfig application ID. Must be between 4 and 7 characters in length.

arn string

ARN of the AppConfig Environment.

description string

Description of the environment. Can be at most 1024 characters.

environmentId string

AppConfig environment ID.

monitors EnvironmentMonitorArgs[]

Set of Amazon CloudWatch alarms to monitor during the deployment process. Maximum of 5. See Monitor below for more details.

name string

Name for the environment. Must be between 1 and 64 characters in length.

state string

State of the environment. Possible values are READY_FOR_DEPLOYMENT, DEPLOYING, ROLLING_BACK or ROLLED_BACK.

tags {[key: string]: string}

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll {[key: string]: string}

Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

application_id str

AppConfig application ID. Must be between 4 and 7 characters in length.

arn str

ARN of the AppConfig Environment.

description str

Description of the environment. Can be at most 1024 characters.

environment_id str

AppConfig environment ID.

monitors Sequence[EnvironmentMonitorArgs]

Set of Amazon CloudWatch alarms to monitor during the deployment process. Maximum of 5. See Monitor below for more details.

name str

Name for the environment. Must be between 1 and 64 characters in length.

state str

State of the environment. Possible values are READY_FOR_DEPLOYMENT, DEPLOYING, ROLLING_BACK or ROLLED_BACK.

tags Mapping[str, str]

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tags_all Mapping[str, str]

Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

applicationId String

AppConfig application ID. Must be between 4 and 7 characters in length.

arn String

ARN of the AppConfig Environment.

description String

Description of the environment. Can be at most 1024 characters.

environmentId String

AppConfig environment ID.

monitors List<Property Map>

Set of Amazon CloudWatch alarms to monitor during the deployment process. Maximum of 5. See Monitor below for more details.

name String

Name for the environment. Must be between 1 and 64 characters in length.

state String

State of the environment. Possible values are READY_FOR_DEPLOYMENT, DEPLOYING, ROLLING_BACK or ROLLED_BACK.

tags Map<String>

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll Map<String>

Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Supporting Types

EnvironmentMonitor

AlarmArn string

ARN of the Amazon CloudWatch alarm.

AlarmRoleArn string

ARN of an IAM role for AWS AppConfig to monitor alarm_arn.

AlarmArn string

ARN of the Amazon CloudWatch alarm.

AlarmRoleArn string

ARN of an IAM role for AWS AppConfig to monitor alarm_arn.

alarmArn String

ARN of the Amazon CloudWatch alarm.

alarmRoleArn String

ARN of an IAM role for AWS AppConfig to monitor alarm_arn.

alarmArn string

ARN of the Amazon CloudWatch alarm.

alarmRoleArn string

ARN of an IAM role for AWS AppConfig to monitor alarm_arn.

alarm_arn str

ARN of the Amazon CloudWatch alarm.

alarm_role_arn str

ARN of an IAM role for AWS AppConfig to monitor alarm_arn.

alarmArn String

ARN of the Amazon CloudWatch alarm.

alarmRoleArn String

ARN of an IAM role for AWS AppConfig to monitor alarm_arn.

Import

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

 $ pulumi import aws:appconfig/environment:Environment example 71abcde:11xxxxx

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.