Skip to content
v2.274.0

SourcedConfiguration ​

A sourced configuration represents configuration stored in an Amazon S3 bucket, AWS Secrets Manager secret, Systems Manager (SSM) Parameter Store parameter, SSM document, or AWS CodePipeline.

Example ​

ts
declare const application: appconfig.Application;
declare const bucket: s3.Bucket;

new appconfig.SourcedConfiguration(this, 'MySourcedConfiguration', {
  application,
  location: appconfig.ConfigurationSource.fromBucket(bucket, 'path/to/file.json'),
  type: appconfig.ConfigurationType.FEATURE_FLAGS,
  name: 'MyConfig',
  description: 'This is my sourced configuration from CDK.',
});
python
# application: appconfig.Application
# bucket: s3.Bucket


appconfig.SourcedConfiguration(self, "MySourcedConfiguration",
    application=application,
    location=appconfig.ConfigurationSource.from_bucket(bucket, "path/to/file.json"),
    type=appconfig.ConfigurationType.FEATURE_FLAGS,
    name="MyConfig",
    description="This is my sourced configuration from CDK."
)
java
Application application;
Bucket bucket;


SourcedConfiguration.Builder.create(this, "MySourcedConfiguration")
        .application(application)
        .location(ConfigurationSource.fromBucket(bucket, "path/to/file.json"))
        .type(ConfigurationType.FEATURE_FLAGS)
        .name("MyConfig")
        .description("This is my sourced configuration from CDK.")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
Application application;
Bucket bucket;


new SourcedConfiguration(this, "MySourcedConfiguration", new SourcedConfigurationProps {
    Application = application,
    Location = ConfigurationSource.FromBucket(bucket, "path/to/file.json"),
    Type = ConfigurationType.FEATURE_FLAGS,
    Name = "MyConfig",
    Description = "This is my sourced configuration from CDK."
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var application Application
var bucket Bucket


appconfig.NewSourcedConfiguration(this, jsii.String("MySourcedConfiguration"), &SourcedConfigurationProps{
	Application: Application,
	Location: appconfig.ConfigurationSource_FromBucket(bucket, jsii.String("path/to/file.json")),
	Type: appconfig.ConfigurationType_FEATURE_FLAGS,
	Name: jsii.String("MyConfig"),
	Description: jsii.String("This is my sourced configuration from CDK."),
})

Initializer ​

ts
new SourcedConfiguration(scope: Construct, id: string, props: SourcedConfigurationProps)
python
SourcedConfiguration(scope: Construct, id: str, props: SourcedConfigurationProps)
java
new SourcedConfiguration(Construct scope, String id, SourcedConfigurationProps props)
csharp
new SourcedConfiguration(Construct scope, string id, SourcedConfigurationProps props)
go
NewSourcedConfiguration(Scope Construct, Id *string, Props SourcedConfigurationProps)

Construct Props ​

applicationIApplicationapplicationIApplicationapplicationIApplicationApplicationIApplicationApplicationIApplicationrequired#
The application associated with the configuration.
deletionProtectionCheckDeletionProtectionCheckdeletion_protection_checkDeletionProtectionCheckdeletionProtectionCheckDeletionProtectionCheckDeletionProtectionCheckDeletionProtectionCheckDeletionProtectionCheckDeletionProtectionCheck#
A parameter to configure deletion protection.

Default: DeletionProtectionCheck.ACCOUNT_DEFAULT

Deletion protection prevents a user from deleting a configuration profile if your application has called either GetLatestConfiguration or GetConfiguration for the configuration profile during the specified interval.

deploymentKeyIKeydeployment_keyIKeydeploymentKeyIKeyDeploymentKeyIKeyDeploymentKeyIKey= None.#
The deployment key of the configuration.
deploymentStrategyIDeploymentStrategyRefdeployment_strategyIDeploymentStrategyRefdeploymentStrategyIDeploymentStrategyRefDeploymentStrategyIDeploymentStrategyRefDeploymentStrategyIDeploymentStrategyRef#
The deployment strategy for the configuration.

Default: A deployment strategy with the rollout strategy set to RolloutStrategy.CANARY_10_PERCENT_20_MINUTES

deployToIEnvironment[]deploy_totyping.List[IEnvironment]deployToList<IEnvironment>DeployToIEnvironment[]DeployTo*[]IEnvironment= None.#
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 the IEnvironment.addDeployment or IEnvironment.addDeployments methods.

descriptionstringdescriptionstrdescriptionStringDescriptionstringDescription*string#
The description of the configuration.

Default: No description.

The location where the configuration is stored.
namestringnamestrnameStringNamestringName*string#
The name of the configuration.

Default: A name is generated.

retrievalRoleIRoleRefretrieval_roleIRoleRefretrievalRoleIRoleRefRetrievalRoleIRoleRefRetrievalRoleIRoleRef#
The IAM role to retrieve the configuration.

Default: Auto generated if location type is not ConfigurationSourceType.CODE_PIPELINE otherwise no role specified.

The type of configuration.
validatorsIValidator[]validatorstyping.List[IValidator]validatorsList<IValidator>ValidatorsIValidator[]Validators*[]IValidator#
The validators for the configuration.

Default: No validators.

versionNumberstringversion_numberstrversionNumberStringVersionNumberstringVersionNumber*string= None.#
The version number of the sourced configuration to deploy.

If this is not specified, then there will be no deployment.

Properties ​

applicationIApplicationapplicationIApplicationapplicationIApplicationApplicationIApplicationApplicationIApplicationrequired#
The application associated with the configuration.
configurationProfileArnstringconfiguration_profile_arnstrconfigurationProfileArnStringConfigurationProfileArnstringConfigurationProfileArn*stringrequired#
The Amazon Resource Name (ARN) of the configuration profile.
configurationProfileIdstringconfiguration_profile_idstrconfigurationProfileIdStringConfigurationProfileIdstringConfigurationProfileId*stringrequired#
The ID of the configuration profile.
deploymentKeyIKeydeployment_keyIKeydeploymentKeyIKeyDeploymentKeyIKeyDeploymentKeyIKey#
The deployment key for the configuration.
deploymentStrategyIDeploymentStrategydeployment_strategyIDeploymentStrategydeploymentStrategyIDeploymentStrategyDeploymentStrategyIDeploymentStrategyDeploymentStrategyIDeploymentStrategy#
The deployment strategy for the configuration.
deployToIEnvironment[]deploy_totyping.List[IEnvironment]deployToList<IEnvironment>DeployToIEnvironment[]DeployTo*[]IEnvironment#
The environments to deploy to.
descriptionstringdescriptionstrdescriptionStringDescriptionstringDescription*string#
The description of the configuration.
The location where the configuration is stored.
namestringnamestrnameStringNamestringName*string#
The name of the configuration.
nodeNodenodeNodenodeNodeNodeNodeNodeNoderequired#
The tree node.
retrievalRoleIRoleretrieval_roleIRoleretrievalRoleIRoleRetrievalRoleIRoleRetrievalRoleIRole#
The IAM role to retrieve the configuration.
sourceKeyIKeysource_keyIKeysourceKeyIKeySourceKeyIKeySourceKeyIKey#
The key to decrypt the configuration if applicable.

This key can be used when storing configuration in AWS Secrets Manager, Systems Manager Parameter Store, or Amazon S3.

validatorsIValidator[]validatorstyping.List[IValidator]validatorsList<IValidator>ValidatorsIValidator[]Validators*[]IValidator#
The validators for the configuration.
versionNumberstringversion_numberstrversionNumberStringVersionNumberstringVersionNumber*string#
The version number of the configuration to deploy.

Methods ​

addExtension(extension: IExtension): voiddef add_extension(self, extension: IExtension) -> Nonepublic void addExtension(IExtension extension)public void AddExtension(IExtension extension)func AddExtension(Extension IExtension)#
Adds an extension association to the configuration profile.
1 parameter

Parameters

  • extensionextensionextensionextensionExtension — The extension to create an association for.
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)#
Adds an AT_DEPLOYMENT_TICK extension with the provided event destination and also creates an extension association to an application.
2 parameters

Parameters

  • eventDestinationevent_destinationeventDestinationeventDestinationEventDestination — The event that occurs during the extension.
  • optionsoptionsoptionsoptionsOptions — Options for the extension.
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#
Checks if `x` is a construct.
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.

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)#
Adds an extension defined by the action point and event destination and also creates an extension association to the configuration profile.
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)#
Adds an ON_DEPLOYMENT_BAKING extension with the provided event destination and also creates an extension association to the configuration profile.
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)#
Adds an ON_DEPLOYMENT_COMPLETE extension with the provided event destination and also creates an extension association to the configuration profile.
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)#
Adds an ON_DEPLOYMENT_ROLLED_BACK extension with the provided event destination and also creates an extension association to the configuration profile.
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)#
Adds an ON_DEPLOYMENT_START extension with the provided event destination and also creates an extension association to the configuration profile.
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)#
Adds an ON_DEPLOYMENT_STEP extension with the provided event destination and also creates an extension association to the configuration profile.
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)#
Adds a PRE_CREATE_HOSTED_CONFIGURATION_VERSION extension with the provided event destination and also creates an extension association to the configuration profile.
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)#
Adds a PRE_START_DEPLOYMENT extension with the provided event destination and also creates an extension association to the configuration profile.
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#
Returns a string representation of this construct.
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#
Applies one or more mixins to this construct.

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.

1 parameter · returns

Parameters

  • mixinsmixinsmixinsmixinsMixins — The mixins to apply.

Returns: This construct for chaining