Application L2 construct
An AWS AppConfig application.
Example
const app = new appconfig.Application(this, 'MyApp');
const env = new appconfig.Environment(this, 'MyEnv', {
application: app,
});
new appconfig.HostedConfiguration(this, 'MyHostedConfig', {
application: app,
deployTo: [env],
content: appconfig.ConfigurationContent.fromInlineText('This is my configuration content.'),
});
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.")
)
Application app = new Application(this, "MyApp");
Environment env = Environment.Builder.create(this, "MyEnv")
.application(app)
.build();
HostedConfiguration.Builder.create(this, "MyHostedConfig")
.application(app)
.deployTo(List.of(env))
.content(ConfigurationContent.fromInlineText("This is my configuration content."))
.build();
// Install: dotnet add package Amazon.CDK.Lib
var app = new Application(this, "MyApp");
var env = new Environment(this, "MyEnv", new EnvironmentProps {
Application = app
});
new HostedConfiguration(this, "MyHostedConfig", new HostedConfigurationProps {
Application = app,
DeployTo = new [] { env },
Content = ConfigurationContent.FromInlineText("This is my configuration content.")
});
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
app := appconfig.NewApplication(this, jsii.String("MyApp"))
env := appconfig.NewEnvironment(this, jsii.String("MyEnv"), &EnvironmentProps{
Application: app,
})
appconfig.NewHostedConfiguration(this, jsii.String("MyHostedConfig"), &HostedConfigurationProps{
Application: app,
DeployTo: []IEnvironment{
env,
},
Content: appconfig.ConfigurationContent_FromInlineText(jsii.String("This is my configuration content.")),
})
Initializer
new Application(scope: Construct, id: string, props?: ApplicationProps)
Application(scope: Construct, id: str, props: typing.Optional[ApplicationProps] = None)
new Application(Construct scope, String id, ApplicationProps props)
new Application(Construct scope, string id, ApplicationProps? props = null)
NewApplication(Scope Construct, Id *string, Props ApplicationProps)
Construct Props
applicationNameoptionalstringapplication_nameoptionalstrapplicationNameoptionalStringApplicationNameoptionalstringApplicationNameoptional*string#Default: A name is generated.
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string#Default: No description.
Properties
applicationArnstringapplication_arnstrapplicationArnStringApplicationArnstringApplicationArn*stringrequired#applicationIdstringapplication_idstrapplicationIdStringApplicationIdstringApplicationId*stringrequired#applicationRefApplicationReferenceapplication_refApplicationReferenceapplicationRefApplicationReferenceApplicationRefApplicationReferenceApplicationRefApplicationReferencerequired#descriptionmay be undefinedstringdescriptionmay be undefinedstrdescriptionmay be undefinedStringDescriptionmay be undefinedstringDescriptionmay be undefined*string#envResourceEnvironmentenvResourceEnvironmentenvResourceEnvironmentEnvResourceEnvironmentEnvResourceEnvironmentrequired#notes
For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.
namemay be undefinedstringnamemay be undefinedstrnamemay be undefinedStringNamemay be undefinedstringNamemay be undefined*string#PROPERTY_INJECTION_IDstringproperty_injection_idstrPROPERTY_INJECTION_IDStringPROPERTY_INJECTION_IDstringPROPERTY_INJECTION_ID*stringrequiredstatic#Methods
addAgentToEcs(taskDef: TaskDefinition): void@staticmethod def add_agent_to_ecs(task_def: TaskDefinition) -> Nonepublic static void addAgentToEcs(TaskDefinition taskDef)public static void AddAgentToEcs(TaskDefinition taskDef)func AddAgentToEcs(TaskDef TaskDefinition)static#1 parameter
Parameters
taskDeftask_deftaskDeftaskDefTaskDef— The ECS task definition [disable-awslint:ref-via-interface].
addEnvironment(id: string, options?: EnvironmentOptions): IEnvironmentdef add_environment(self, id: str, options: typing.Optional[EnvironmentOptions] = None) -> IEnvironmentpublic IEnvironment addEnvironment(String id, EnvironmentOptions options)public IEnvironment AddEnvironment(string id, EnvironmentOptions? options = null)func AddEnvironment(Id *string, Options EnvironmentOptions) IEnvironment#addExistingEnvironment(environment: IEnvironmentRef): voiddef add_existing_environment(self, environment: IEnvironmentRef) -> Nonepublic void addExistingEnvironment(IEnvironmentRef environment)public void AddExistingEnvironment(IEnvironmentRef environment)func AddExistingEnvironment(Environment IEnvironmentRef)#addExtension(extension: IExtension): voiddef add_extension(self, extension: IExtension) -> Nonepublic void addExtension(IExtension extension)public void AddExtension(IExtension extension)func AddExtension(Extension IExtension)#1 parameter
Parameters
extensionextensionextensionextensionExtension— The extension to create an association for.
addHostedConfiguration(id: string, options: HostedConfigurationOptions): HostedConfigurationdef add_hosted_configuration(self, id: str, options: HostedConfigurationOptions) -> HostedConfigurationpublic HostedConfiguration addHostedConfiguration(String id, HostedConfigurationOptions options)public HostedConfiguration AddHostedConfiguration(string id, HostedConfigurationOptions options)func AddHostedConfiguration(Id *string, Options HostedConfigurationOptions) HostedConfiguration#addSourcedConfiguration(id: string, options: SourcedConfigurationOptions): SourcedConfigurationdef add_sourced_configuration(self, id: str, options: SourcedConfigurationOptions) -> SourcedConfigurationpublic SourcedConfiguration addSourcedConfiguration(String id, SourcedConfigurationOptions options)public SourcedConfiguration AddSourcedConfiguration(string id, SourcedConfigurationOptions options)func AddSourcedConfiguration(Id *string, Options SourcedConfigurationOptions) SourcedConfiguration#applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength)#notes · 1 parameter
When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the @aws-cdk/core:defaultCrossStackReferences context key. This is useful for selectively weakening specific references to avoid the "deadly embrace" problem without changing the app-wide default.
Parameters
strengthstrengthstrengthstrengthStrength— - The reference strength to use for this resource.
applyRemovalPolicy(policy: RemovalPolicy): voiddef apply_removal_policy(self, policy: RemovalPolicy) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy)public void ApplyRemovalPolicy(RemovalPolicy policy)func ApplyRemovalPolicy(Policy RemovalPolicy)#notes
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).
atDeploymentTick(eventDestination: IEventDestination, options?: ExtensionOptions): voiddef at_deployment_tick(self, event_destination: IEventDestination, options: typing.Optional[ExtensionOptions] = None) -> Nonepublic void atDeploymentTick(IEventDestination eventDestination, ExtensionOptions options)public void AtDeploymentTick(IEventDestination eventDestination, ExtensionOptions? options = null)func AtDeploymentTick(EventDestination IEventDestination, Options ExtensionOptions)#2 parameters
Parameters
eventDestinationevent_destinationeventDestinationeventDestinationEventDestination— The event that occurs during the extension.optionsoptionsoptionsoptionsOptions— Options for the extension.
environments(): IEnvironment[]def environments(self, ) -> typing.List[IEnvironment]public List<IEnvironment> environments()public IEnvironment[] Environments()func Environments() *[]IEnvironment#fromApplicationArn(scope: Construct, id: string, applicationArn: string): IApplication@staticmethod def from_application_arn(scope: Construct, id: str, application_arn: str) -> IApplicationpublic static IApplication fromApplicationArn(Construct scope, String id, String applicationArn)public static IApplication FromApplicationArn(Construct scope, string id, string applicationArn)func FromApplicationArn(Scope Construct, Id *string, ApplicationArn *string) IApplicationstatic#3 parameters
Parameters
scopescopescopescopeScope— The parent construct.ididididId— The name of the application construct.applicationArnapplication_arnapplicationArnapplicationArnApplicationArn— The Amazon Resource Name (ARN) of the application.
fromApplicationId(scope: Construct, id: string, applicationId: string): IApplication@staticmethod def from_application_id(scope: Construct, id: str, application_id: str) -> IApplicationpublic static IApplication fromApplicationId(Construct scope, String id, String applicationId)public static IApplication FromApplicationId(Construct scope, string id, string applicationId)func FromApplicationId(Scope Construct, Id *string, ApplicationId *string) IApplicationstatic#3 parameters
Parameters
scopescopescopescopeScope— The parent construct.ididididId— The name of the application construct.applicationIdapplication_idapplicationIdapplicationIdApplicationId— The ID of the application.
getLambdaLayerVersionArn(region: string, platform?: Platform): string@staticmethod def get_lambda_layer_version_arn(region: str, platform: typing.Optional[Platform] = None) -> strpublic static String getLambdaLayerVersionArn(String region, Platform platform)public static string GetLambdaLayerVersionArn(string region, Platform? platform = null)func GetLambdaLayerVersionArn(Region *string, Platform Platform) *stringstatic#2 parameters · returns
Parameters
regionregionregionregionRegion— The region for the Lambda layer (for example, 'us-east-1').platformplatformplatformplatformPlatform— The platform for the Lambda layer (default is Platform.X86_64).
Returns: Lambda layer version ARN
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#notes · 1 parameter · returns
Use this method instead of instanceof to properly detect Construct 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 class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof 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 the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.
Parameters
xxxxX— Any object.
Returns: true if x is an object created from a class which extends Construct.
isOwnedResource(construct: IConstruct): boolean@staticmethod def is_owned_resource(construct: IConstruct) -> boolpublic static Boolean isOwnedResource(IConstruct construct)public static bool IsOwnedResource(IConstruct construct)func IsOwnedResource(Construct IConstruct) *boolstatic#isResource(construct: IConstruct): boolean@staticmethod def is_resource(construct: IConstruct) -> boolpublic static Boolean isResource(IConstruct construct)public static bool IsResource(IConstruct construct)func IsResource(Construct IConstruct) *boolstatic#on(actionPoint: ActionPoint, eventDestination: IEventDestination, options?: ExtensionOptions): voiddef on(self, action_point: ActionPoint, event_destination: IEventDestination, options: typing.Optional[ExtensionOptions] = None) -> Nonepublic void on(ActionPoint actionPoint, IEventDestination eventDestination, ExtensionOptions options)public void On(ActionPoint actionPoint, IEventDestination eventDestination, ExtensionOptions? options = null)func On(ActionPoint ActionPoint, EventDestination IEventDestination, Options ExtensionOptions)#3 parameters
Parameters
actionPointaction_pointactionPointactionPointActionPoint— The action point which triggers the event.eventDestinationevent_destinationeventDestinationeventDestinationEventDestination— The event that occurs during the extension.optionsoptionsoptionsoptionsOptions— Options for the extension.
onDeploymentBaking(eventDestination: IEventDestination, options?: ExtensionOptions): voiddef on_deployment_baking(self, event_destination: IEventDestination, options: typing.Optional[ExtensionOptions] = None) -> Nonepublic void onDeploymentBaking(IEventDestination eventDestination, ExtensionOptions options)public void OnDeploymentBaking(IEventDestination eventDestination, ExtensionOptions? options = null)func OnDeploymentBaking(EventDestination IEventDestination, Options ExtensionOptions)#2 parameters
Parameters
eventDestinationevent_destinationeventDestinationeventDestinationEventDestination— The event that occurs during the extension.optionsoptionsoptionsoptionsOptions— Options for the extension.
onDeploymentComplete(eventDestination: IEventDestination, options?: ExtensionOptions): voiddef on_deployment_complete(self, event_destination: IEventDestination, options: typing.Optional[ExtensionOptions] = None) -> Nonepublic void onDeploymentComplete(IEventDestination eventDestination, ExtensionOptions options)public void OnDeploymentComplete(IEventDestination eventDestination, ExtensionOptions? options = null)func OnDeploymentComplete(EventDestination IEventDestination, Options ExtensionOptions)#2 parameters
Parameters
eventDestinationevent_destinationeventDestinationeventDestinationEventDestination— The event that occurs during the extension.optionsoptionsoptionsoptionsOptions— Options for the extension.
onDeploymentRolledBack(eventDestination: IEventDestination, options?: ExtensionOptions): voiddef on_deployment_rolled_back(self, event_destination: IEventDestination, options: typing.Optional[ExtensionOptions] = None) -> Nonepublic void onDeploymentRolledBack(IEventDestination eventDestination, ExtensionOptions options)public void OnDeploymentRolledBack(IEventDestination eventDestination, ExtensionOptions? options = null)func OnDeploymentRolledBack(EventDestination IEventDestination, Options ExtensionOptions)#2 parameters
Parameters
eventDestinationevent_destinationeventDestinationeventDestinationEventDestination— The event that occurs during the extension.optionsoptionsoptionsoptionsOptions— Options for the extension.
onDeploymentStart(eventDestination: IEventDestination, options?: ExtensionOptions): voiddef on_deployment_start(self, event_destination: IEventDestination, options: typing.Optional[ExtensionOptions] = None) -> Nonepublic void onDeploymentStart(IEventDestination eventDestination, ExtensionOptions options)public void OnDeploymentStart(IEventDestination eventDestination, ExtensionOptions? options = null)func OnDeploymentStart(EventDestination IEventDestination, Options ExtensionOptions)#2 parameters
Parameters
eventDestinationevent_destinationeventDestinationeventDestinationEventDestination— The event that occurs during the extension.optionsoptionsoptionsoptionsOptions— Options for the extension.
onDeploymentStep(eventDestination: IEventDestination, options?: ExtensionOptions): voiddef on_deployment_step(self, event_destination: IEventDestination, options: typing.Optional[ExtensionOptions] = None) -> Nonepublic void onDeploymentStep(IEventDestination eventDestination, ExtensionOptions options)public void OnDeploymentStep(IEventDestination eventDestination, ExtensionOptions? options = null)func OnDeploymentStep(EventDestination IEventDestination, Options ExtensionOptions)#2 parameters
Parameters
eventDestinationevent_destinationeventDestinationeventDestinationEventDestination— The event that occurs during the extension.optionsoptionsoptionsoptionsOptions— Options for the extension.
preCreateHostedConfigurationVersion(eventDestination: IEventDestination, options?: ExtensionOptions): voiddef pre_create_hosted_configuration_version(self, event_destination: IEventDestination, options: typing.Optional[ExtensionOptions] = None) -> Nonepublic void preCreateHostedConfigurationVersion(IEventDestination eventDestination, ExtensionOptions options)public void PreCreateHostedConfigurationVersion(IEventDestination eventDestination, ExtensionOptions? options = null)func PreCreateHostedConfigurationVersion(EventDestination IEventDestination, Options ExtensionOptions)#2 parameters
Parameters
eventDestinationevent_destinationeventDestinationeventDestinationEventDestination— The event that occurs during the extension.optionsoptionsoptionsoptionsOptions— Options for the extension.
preStartDeployment(eventDestination: IEventDestination, options?: ExtensionOptions): voiddef pre_start_deployment(self, event_destination: IEventDestination, options: typing.Optional[ExtensionOptions] = None) -> Nonepublic void preStartDeployment(IEventDestination eventDestination, ExtensionOptions options)public void PreStartDeployment(IEventDestination eventDestination, ExtensionOptions? options = null)func PreStartDeployment(EventDestination IEventDestination, Options ExtensionOptions)#2 parameters
Parameters
eventDestinationevent_destinationeventDestinationeventDestinationEventDestination— The event that occurs during the extension.optionsoptionsoptionsoptionsOptions— Options for the extension.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.