class Environment (construct)
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.AppConfig.Environment |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsappconfig#Environment |
Java | software.amazon.awscdk.services.appconfig.Environment |
Python | aws_cdk.aws_appconfig.Environment |
TypeScript (source) | aws-cdk-lib » aws_appconfig » Environment |
Implements
IConstruct
, IDependable
, IResource
, IEnvironment
, IExtensible
An AWS AppConfig environment.
Example
const app = new appconfig.Application(this, 'MyApp');
const env = new appconfig.Environment(this, 'MyEnv', {
application: app,
});
new appconfig.HostedConfiguration(this, 'MyFirstHostedConfig', {
application: app,
deployTo: [env],
content: appconfig.ConfigurationContent.fromInlineText('This is my first configuration content.'),
});
new appconfig.HostedConfiguration(this, 'MySecondHostedConfig', {
application: app,
deployTo: [env],
content: appconfig.ConfigurationContent.fromInlineText('This is my second configuration content.'),
});
Initializer
new Environment(scope: Construct, id: string, props: EnvironmentProps)
Parameters
- scope
Construct
- id
string
- props
Environment
Props
Construct Props
Name | Type | Description |
---|---|---|
application | IApplication | The application to be associated with the environment. |
description? | string | The description of the environment. |
environment | string | The name of the environment. |
monitors? | Monitor [] | The monitors for the environment. |
application
Type:
IApplication
The application to be associated with the environment.
description?
Type:
string
(optional, default: No description.)
The description of the environment.
environmentName?
Type:
string
(optional, default: A name is generated.)
The name of the environment.
monitors?
Type:
Monitor
[]
(optional, default: No monitors.)
The monitors for the environment.
Properties
Name | Type | Description |
---|---|---|
application | string | The ID of the environment. |
deployment | Cfn [] | |
env | Resource | The environment this resource belongs to. |
environment | string | The Amazon Resource Name (ARN) of the environment. |
environment | string | The ID of the environment. |
extensible | Extensible | |
node | Node | The tree node. |
stack | Stack | The stack in which this resource is defined. |
application? | IApplication | The application associated with the environment. |
description? | string | The description of the environment. |
monitors? | Monitor [] | The monitors for the environment. |
name? | string | The name of the environment. |
applicationId
Type:
string
The ID of the environment.
deploymentQueue
Type:
Cfn
[]
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
environmentArn
Type:
string
The Amazon Resource Name (ARN) of the environment.
environmentId
Type:
string
The ID of the environment.
extensible
Type:
Extensible
node
Type:
Node
The tree node.
stack
Type:
Stack
The stack in which this resource is defined.
application?
Type:
IApplication
(optional)
The application associated with the environment.
description?
Type:
string
(optional)
The description of the environment.
monitors?
Type:
Monitor
[]
(optional)
The monitors for the environment.
name?
Type:
string
(optional)
The name of the environment.
Methods
Name | Description |
---|---|
add | Creates a deployment of the supplied configuration to this environment. |
add | Creates a deployment for each of the supplied configurations to this environment. |
add | Adds an extension association to the environment. |
apply | Apply the given removal policy to this resource. |
grant(grantee, ...actions) | Adds an IAM policy statement associated with this environment to an IAM principal's policy. |
grant | Permits an IAM principal to perform read operations on this environment's configurations. |
on(actionPoint, eventDestination, options?) | Adds an extension defined by the action point and event destination and also creates an extension association to the environment. |
on | Adds an ON_DEPLOYMENT_BAKING extension with the provided event destination and also creates an extension association to the environment. |
on | Adds an ON_DEPLOYMENT_COMPLETE extension with the provided event destination and also creates an extension association to the environment. |
on | Adds an ON_DEPLOYMENT_ROLLED_BACK extension with the provided event destination and also creates an extension association to the environment. |
on | Adds an ON_DEPLOYMENT_START extension with the provided event destination and also creates an extension association to the environment. |
on | Adds an ON_DEPLOYMENT_STEP extension with the provided event destination and also creates an extension association to the environment. |
pre | Adds a PRE_CREATE_HOSTED_CONFIGURATION_VERSION extension with the provided event destination and also creates an extension association to the environment. |
pre | Adds a PRE_START_DEPLOYMENT extension with the provided event destination and also creates an extension association to the environment. |
to | Returns a string representation of this construct. |
static from | Imports an environment into the CDK using its Amazon Resource Name (ARN). |
static from | Imports an environment into the CDK from its attributes. |
Deployment(configuration)
addpublic addDeployment(configuration: IConfiguration): void
Parameters
- configuration
IConfiguration
Creates a deployment of the supplied configuration to this environment.
Note that you can only deploy one configuration at a time to an environment. However, you can deploy one configuration each to different environments at the same time. If more than one deployment is requested for this environment, they will occur in the same order they were provided.
Deployments(...configurations)
addpublic addDeployments(...configurations: IConfiguration[]): void
Parameters
- configurations
IConfiguration
Creates a deployment for each of the supplied configurations to this environment.
These configurations will be deployed in the same order as the input array.
Extension(extension)
addpublic addExtension(extension: IExtension): void
Parameters
- extension
IExtension
Adds an extension association to the environment.
RemovalPolicy(policy)
applypublic applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
grant(grantee, ...actions)
public grant(grantee: IGrantable, ...actions: string[]): Grant
Parameters
- grantee
IGrantable
- actions
string
Returns
Adds an IAM policy statement associated with this environment to an IAM principal's policy.
ReadConfig(identity)
grantpublic grantReadConfig(identity: IGrantable): Grant
Parameters
- identity
IGrantable
Returns
Permits an IAM principal to perform read operations on this environment's configurations.
Actions: GetLatestConfiguration, StartConfigurationSession.
on(actionPoint, eventDestination, options?)
public on(actionPoint: ActionPoint, eventDestination: IEventDestination, options?: ExtensionOptions): void
Parameters
- actionPoint
Action
Point - eventDestination
IEvent
Destination - options
Extension
Options
Adds an extension defined by the action point and event destination and also creates an extension association to the environment.
DeploymentBaking(eventDestination, options?)
onpublic onDeploymentBaking(eventDestination: IEventDestination, options?: ExtensionOptions): void
Parameters
- eventDestination
IEvent
Destination - options
Extension
Options
Adds an ON_DEPLOYMENT_BAKING extension with the provided event destination and also creates an extension association to the environment.
DeploymentComplete(eventDestination, options?)
onpublic onDeploymentComplete(eventDestination: IEventDestination, options?: ExtensionOptions): void
Parameters
- eventDestination
IEvent
Destination - options
Extension
Options
Adds an ON_DEPLOYMENT_COMPLETE extension with the provided event destination and also creates an extension association to the environment.
DeploymentRolledBack(eventDestination, options?)
onpublic onDeploymentRolledBack(eventDestination: IEventDestination, options?: ExtensionOptions): void
Parameters
- eventDestination
IEvent
Destination - options
Extension
Options
Adds an ON_DEPLOYMENT_ROLLED_BACK extension with the provided event destination and also creates an extension association to the environment.
DeploymentStart(eventDestination, options?)
onpublic onDeploymentStart(eventDestination: IEventDestination, options?: ExtensionOptions): void
Parameters
- eventDestination
IEvent
Destination - options
Extension
Options
Adds an ON_DEPLOYMENT_START extension with the provided event destination and also creates an extension association to the environment.
DeploymentStep(eventDestination, options?)
onpublic onDeploymentStep(eventDestination: IEventDestination, options?: ExtensionOptions): void
Parameters
- eventDestination
IEvent
Destination - options
Extension
Options
Adds an ON_DEPLOYMENT_STEP extension with the provided event destination and also creates an extension association to the environment.
CreateHostedConfigurationVersion(eventDestination, options?)
prepublic preCreateHostedConfigurationVersion(eventDestination: IEventDestination, options?: ExtensionOptions): void
Parameters
- eventDestination
IEvent
Destination - options
Extension
Options
Adds a PRE_CREATE_HOSTED_CONFIGURATION_VERSION extension with the provided event destination and also creates an extension association to the environment.
StartDeployment(eventDestination, options?)
prepublic preStartDeployment(eventDestination: IEventDestination, options?: ExtensionOptions): void
Parameters
- eventDestination
IEvent
Destination - options
Extension
Options
Adds a PRE_START_DEPLOYMENT extension with the provided event destination and also creates an extension association to the environment.
String()
topublic toString(): string
Returns
string
Returns a string representation of this construct.
EnvironmentArn(scope, id, environmentArn)
static frompublic static fromEnvironmentArn(scope: Construct, id: string, environmentArn: string): IEnvironment
Parameters
- scope
Construct
— The parent construct. - id
string
— The name of the environment construct. - environmentArn
string
— The Amazon Resource Name (ARN) of the environment.
Returns
Imports an environment into the CDK using its Amazon Resource Name (ARN).
EnvironmentAttributes(scope, id, attrs)
static frompublic static fromEnvironmentAttributes(scope: Construct, id: string, attrs: EnvironmentAttributes): IEnvironment
Parameters
- scope
Construct
— The parent construct. - id
string
— The name of the environment construct. - attrs
Environment
— The attributes of the environment.Attributes
Returns
Imports an environment into the CDK from its attributes.