SourcedConfiguration

class aws_cdk.aws_appconfig.SourcedConfiguration(scope, id, *, location, retrieval_role=None, version_number=None, application, deployment_key=None, deployment_strategy=None, deploy_to=None, description=None, name=None, type=None, validators=None)

Bases: Construct

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.

ExampleMetadata:

infused

Example:

# 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."
)
Parameters:
  • scope (Construct) –

  • id (str) –

  • location (ConfigurationSource) – The location where the configuration is stored.

  • retrieval_role (Optional[IRole]) – The IAM role to retrieve the configuration. Default: - Auto generated if location type is not ConfigurationSourceType.CODE_PIPELINE otherwise no role specified.

  • 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.

  • application (IApplication) – The application associated with the configuration.

  • 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_MINUTES

  • deploy_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 the IEnvironment.addDeployment or IEnvironment.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.FREEFORM

  • validators (Optional[Sequence[IValidator]]) – The validators for the configuration. Default: - No validators.

Methods

add_extension(extension)

Adds an extension association to the configuration profile.

Parameters:

extension (IExtension) – The extension to create an association for.

Return type:

None

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 the configuration profile.

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 the configuration profile.

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 the configuration profile.

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 the configuration profile.

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 the configuration profile.

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 the configuration profile.

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 the configuration profile.

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 the configuration profile.

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

The application associated with the configuration.

configuration_profile_arn

The Amazon Resource Name (ARN) of the configuration profile.

configuration_profile_id

The ID of the configuration profile.

deploy_to

The environments to deploy to.

deployment_key

The deployment key for the configuration.

deployment_strategy

The deployment strategy for the configuration.

description

The description of the configuration.

location

The location where the configuration is stored.

name

The name of the configuration.

node

The tree node.

retrieval_role

The IAM role to retrieve the configuration.

source_key

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.

type

The configuration type.

validators

The validators for the configuration.

version_number

The version number of the configuration to deploy.

Static Methods

classmethod is_construct(x)

Checks if x is a construct.

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:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Construct.