Application
- class aws_cdk.aws_appconfig.Application(scope, id, *, application_name=None, description=None)
Bases:
Resource
An AWS AppConfig application.
- See:
https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-creating-application.html
- Resource:
AWS::AppConfig::Application
- ExampleMetadata:
infused
Example:
app = appconfig.Application(self, "MyApp") env = appconfig.Environment(self, "MyEnv", application=app ) appconfig.HostedConfiguration(self, "MyHostedConfig", application=app, deploy_to=[env], content=appconfig.ConfigurationContent.from_inline_text("This is my configuration content.") )
- Parameters:
scope (
Construct
) –id (
str
) –application_name (
Optional
[str
]) – The name of the application. Default: - A name is generated.description (
Optional
[str
]) – The description for the application. Default: - No description.
Methods
- add_environment(id, *, description=None, environment_name=None, monitors=None)
Adds an environment.
- Parameters:
id (
str
) –description (
Optional
[str
]) – The description of the environment. Default: - No description.environment_name (
Optional
[str
]) – The name of the environment. Default: - A name is generated.monitors (
Optional
[Sequence
[Monitor
]]) – The monitors for the environment. Default: - No monitors.
- Return type:
- add_existing_environment(environment)
Adds an existing environment.
- Parameters:
environment (
IEnvironment
) –- Return type:
None
- add_extension(extension)
Adds an extension association to the application.
- Parameters:
extension (
IExtension
) – The extension to create an association for.- Return type:
None
- add_hosted_configuration(id, *, content, latest_version_number=None, version_label=None, deployment_key=None, deployment_strategy=None, deploy_to=None, description=None, name=None, type=None, validators=None)
Adds a hosted configuration.
- Parameters:
id (
str
) –content (
ConfigurationContent
) – The content of the hosted configuration.latest_version_number (
Union
[int
,float
,None
]) – The latest version number of the hosted configuration. Default: - None.version_label (
Optional
[str
]) – The version label of the hosted configuration. Default: - None.deployment_key (
Optional
[IKey
]) – The deployment key of the configuration. Default: - None.deployment_strategy (
Optional
[IDeploymentStrategy
]) – The deployment strategy for the configuration. Default: - A deployment strategy with the rollout strategy set to RolloutStrategy.CANARY_10_PERCENT_20_MINUTESdeploy_to (
Optional
[Sequence
[IEnvironment
]]) – The list of environments to deploy the configuration to. If this parameter is not specified, then there will be no deployment created alongside this configuration. Deployments can be added later using theIEnvironment.addDeployment
orIEnvironment.addDeployments
methods. Default: - None.description (
Optional
[str
]) – The description of the configuration. Default: - No description.name (
Optional
[str
]) – The name of the configuration. Default: - A name is generated.type (
Optional
[ConfigurationType
]) – The type of configuration. Default: ConfigurationType.FREEFORMvalidators (
Optional
[Sequence
[IValidator
]]) – The validators for the configuration. Default: - No validators.
- Return type:
- add_sourced_configuration(id, *, location, retrieval_role=None, version_number=None, deployment_key=None, deployment_strategy=None, deploy_to=None, description=None, name=None, type=None, validators=None)
Adds a sourced configuration.
- Parameters:
id (
str
) –location (
ConfigurationSource
) – The location where the configuration is stored.retrieval_role (
Optional
[IRole
]) – The IAM role to retrieve the configuration. Default: - A role is generated.version_number (
Optional
[str
]) – The version number of the sourced configuration to deploy. If this is not specified, then there will be no deployment. Default: - None.deployment_key (
Optional
[IKey
]) – The deployment key of the configuration. Default: - None.deployment_strategy (
Optional
[IDeploymentStrategy
]) – The deployment strategy for the configuration. Default: - A deployment strategy with the rollout strategy set to RolloutStrategy.CANARY_10_PERCENT_20_MINUTESdeploy_to (
Optional
[Sequence
[IEnvironment
]]) – The list of environments to deploy the configuration to. If this parameter is not specified, then there will be no deployment created alongside this configuration. Deployments can be added later using theIEnvironment.addDeployment
orIEnvironment.addDeployments
methods. Default: - None.description (
Optional
[str
]) – The description of the configuration. Default: - No description.name (
Optional
[str
]) – The name of the configuration. Default: - A name is generated.type (
Optional
[ConfigurationType
]) – The type of configuration. Default: ConfigurationType.FREEFORMvalidators (
Optional
[Sequence
[IValidator
]]) – The validators for the configuration. Default: - No validators.
- Return type:
- apply_removal_policy(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
).- Parameters:
policy (
RemovalPolicy
) –- Return type:
None
- environments()
Returns the list of associated environments.
- Return type:
List
[IEnvironment
]
- on(action_point, event_destination, *, description=None, extension_name=None, latest_version_number=None, parameters=None)
Adds an extension defined by the action point and event destination and also creates an extension association to an application.
- Parameters:
action_point (
ActionPoint
) – The action point which triggers the event.event_destination (
IEventDestination
) – The event that occurs during the extension.description (
Optional
[str
]) – A description of the extension. Default: - No description.extension_name (
Optional
[str
]) – The name of the extension. Default: - A name is generated.latest_version_number (
Union
[int
,float
,None
]) – The latest version number of the extension. When you create a new version, specify the most recent current version number. For example, you create version 3, enter 2 for this field. Default: - None.parameters (
Optional
[Sequence
[Parameter
]]) – The parameters accepted for the extension. Default: - None.
- Return type:
None
- on_deployment_baking(event_destination, *, description=None, extension_name=None, latest_version_number=None, parameters=None)
Adds an ON_DEPLOYMENT_BAKING extension with the provided event destination and also creates an extension association to an application.
- Parameters:
event_destination (
IEventDestination
) – The event that occurs during the extension.description (
Optional
[str
]) – A description of the extension. Default: - No description.extension_name (
Optional
[str
]) – The name of the extension. Default: - A name is generated.latest_version_number (
Union
[int
,float
,None
]) – The latest version number of the extension. When you create a new version, specify the most recent current version number. For example, you create version 3, enter 2 for this field. Default: - None.parameters (
Optional
[Sequence
[Parameter
]]) – The parameters accepted for the extension. Default: - None.
- Return type:
None
- on_deployment_complete(event_destination, *, description=None, extension_name=None, latest_version_number=None, parameters=None)
Adds an ON_DEPLOYMENT_COMPLETE extension with the provided event destination and also creates an extension association to an application.
- Parameters:
event_destination (
IEventDestination
) – The event that occurs during the extension.description (
Optional
[str
]) – A description of the extension. Default: - No description.extension_name (
Optional
[str
]) – The name of the extension. Default: - A name is generated.latest_version_number (
Union
[int
,float
,None
]) – The latest version number of the extension. When you create a new version, specify the most recent current version number. For example, you create version 3, enter 2 for this field. Default: - None.parameters (
Optional
[Sequence
[Parameter
]]) – The parameters accepted for the extension. Default: - None.
- Return type:
None
- on_deployment_rolled_back(event_destination, *, description=None, extension_name=None, latest_version_number=None, parameters=None)
Adds an ON_DEPLOYMENT_ROLLED_BACK extension with the provided event destination and also creates an extension association to an application.
- Parameters:
event_destination (
IEventDestination
) – The event that occurs during the extension.description (
Optional
[str
]) – A description of the extension. Default: - No description.extension_name (
Optional
[str
]) – The name of the extension. Default: - A name is generated.latest_version_number (
Union
[int
,float
,None
]) – The latest version number of the extension. When you create a new version, specify the most recent current version number. For example, you create version 3, enter 2 for this field. Default: - None.parameters (
Optional
[Sequence
[Parameter
]]) – The parameters accepted for the extension. Default: - None.
- Return type:
None
- on_deployment_start(event_destination, *, description=None, extension_name=None, latest_version_number=None, parameters=None)
Adds an ON_DEPLOYMENT_START extension with the provided event destination and also creates an extension association to an application.
- Parameters:
event_destination (
IEventDestination
) – The event that occurs during the extension.description (
Optional
[str
]) – A description of the extension. Default: - No description.extension_name (
Optional
[str
]) – The name of the extension. Default: - A name is generated.latest_version_number (
Union
[int
,float
,None
]) – The latest version number of the extension. When you create a new version, specify the most recent current version number. For example, you create version 3, enter 2 for this field. Default: - None.parameters (
Optional
[Sequence
[Parameter
]]) – The parameters accepted for the extension. Default: - None.
- Return type:
None
- on_deployment_step(event_destination, *, description=None, extension_name=None, latest_version_number=None, parameters=None)
Adds an ON_DEPLOYMENT_STEP extension with the provided event destination and also creates an extension association to an application.
- Parameters:
event_destination (
IEventDestination
) – The event that occurs during the extension.description (
Optional
[str
]) – A description of the extension. Default: - No description.extension_name (
Optional
[str
]) – The name of the extension. Default: - A name is generated.latest_version_number (
Union
[int
,float
,None
]) – The latest version number of the extension. When you create a new version, specify the most recent current version number. For example, you create version 3, enter 2 for this field. Default: - None.parameters (
Optional
[Sequence
[Parameter
]]) – The parameters accepted for the extension. Default: - None.
- Return type:
None
- pre_create_hosted_configuration_version(event_destination, *, description=None, extension_name=None, latest_version_number=None, parameters=None)
Adds a PRE_CREATE_HOSTED_CONFIGURATION_VERSION extension with the provided event destination and also creates an extension association to an application.
- Parameters:
event_destination (
IEventDestination
) – The event that occurs during the extension.description (
Optional
[str
]) – A description of the extension. Default: - No description.extension_name (
Optional
[str
]) – The name of the extension. Default: - A name is generated.latest_version_number (
Union
[int
,float
,None
]) – The latest version number of the extension. When you create a new version, specify the most recent current version number. For example, you create version 3, enter 2 for this field. Default: - None.parameters (
Optional
[Sequence
[Parameter
]]) – The parameters accepted for the extension. Default: - None.
- Return type:
None
- pre_start_deployment(event_destination, *, description=None, extension_name=None, latest_version_number=None, parameters=None)
Adds a PRE_START_DEPLOYMENT extension with the provided event destination and also creates an extension association to an application.
- Parameters:
event_destination (
IEventDestination
) – The event that occurs during the extension.description (
Optional
[str
]) – A description of the extension. Default: - No description.extension_name (
Optional
[str
]) – The name of the extension. Default: - A name is generated.latest_version_number (
Union
[int
,float
,None
]) – The latest version number of the extension. When you create a new version, specify the most recent current version number. For example, you create version 3, enter 2 for this field. Default: - None.parameters (
Optional
[Sequence
[Parameter
]]) – The parameters accepted for the extension. Default: - None.
- Return type:
None
- to_string()
Returns a string representation of this construct.
- Return type:
str
Attributes
- application_arn
The Amazon Resource Name (ARN) of the application.
- Attribute:
true
- application_id
The ID of the application.
- Attribute:
true
- description
The description of the application.
- env
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.
- name
The name of the application.
- node
The tree node.
- stack
The stack in which this resource is defined.
Static Methods
- classmethod add_agent_to_ecs(task_def)
Adds the AWS AppConfig Agent as a container to the provided ECS task definition.
- Parameters:
task_def (
TaskDefinition
) – The ECS task definition [disable-awslint:ref-via-interface].- Return type:
None
- classmethod from_application_arn(scope, id, application_arn)
Imports an AWS AppConfig application into the CDK using its Amazon Resource Name (ARN).
- Parameters:
scope (
Construct
) – The parent construct.id (
str
) – The name of the application construct.application_arn (
str
) – The Amazon Resource Name (ARN) of the application.
- Return type:
- classmethod from_application_id(scope, id, application_id)
Imports an AWS AppConfig application into the CDK using its ID.
- Parameters:
scope (
Construct
) – The parent construct.id (
str
) – The name of the application construct.application_id (
str
) – The ID of the application.
- Return type:
- classmethod get_lambda_layer_version_arn(region, platform=None)
Retrieves the Lambda layer version Amazon Resource Name (ARN) for the AWS AppConfig Lambda extension.
- Parameters:
region (
str
) – The region for the Lambda layer (for example, ‘us-east-1’).platform (
Optional
[Platform
]) – The platform for the Lambda layer (default is Platform.X86_64).
- Return type:
str
- Returns:
Lambda layer version ARN
- classmethod is_construct(x)
Checks if
x
is a construct.Use this method instead of
instanceof
to properly detectConstruct
instances, even when the construct library is symlinked.Explanation: in JavaScript, multiple copies of the
constructs
library on disk are seen as independent, completely different libraries. As a consequence, the classConstruct
in each copy of theconstructs
library is seen as a different class, and an instance of one class will not test asinstanceof
the other class.npm install
will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of theconstructs
library can be accidentally installed, andinstanceof
will behave unpredictably. It is safest to avoid usinginstanceof
, and using this type-testing method instead.- Parameters:
x (
Any
) – Any object.- Return type:
bool
- Returns:
true if
x
is an object created from a class which extendsConstruct
.
- classmethod is_owned_resource(construct)
Returns true if the construct was created by CDK, and false otherwise.
- Parameters:
construct (
IConstruct
) –- Return type:
bool
- classmethod is_resource(construct)
Check whether the given construct is a Resource.
- Parameters:
construct (
IConstruct
) –- Return type:
bool