ApplicationAssociator

class aws_cdk.aws_servicecatalogappregistry_alpha.ApplicationAssociator(scope, id, *, applications)

Bases: Construct

(experimental) An AppRegistry construct to automatically create an application with the given name and description.

The application name must be unique at the account level per region and it’s immutable. This construct will automatically associate all stacks in the given scope, however in case of a Pipeline stack, stage underneath the pipeline will not automatically be associated and needs to be associated separately.

If cross account stack is detected and associateCrossAccountStacks in TargetApplicationOptions is true, then the application will automatically be shared with the consumer accounts to allow associations. Otherwise, the application will not be shared. Cross account feature will only work for non environment agnostic stacks.

Stability:

experimental

ExampleMetadata:

infused

Example:

import aws_cdk as cdk


app = App()

associated_app = appreg.ApplicationAssociator(app, "AssociatedApplication",
    applications=[appreg.TargetApplication.create_application_stack(
        application_name="MyAssociatedApplication",
        # 'Application containing stacks deployed via CDK.' is the default
        application_description="Associated Application description",
        stack_name="MyAssociatedApplicationStack",
        # AWS Account and Region that are implied by the current CLI configuration is the default
        env=cdk.Environment(account="123456789012", region="us-east-1")
    )]
)

# Associate application to the attribute group.
associated_app.app_registry_application.add_attribute_group("MyAttributeGroup",
    attribute_group_name="MyAttributeGroupName",
    description="Test attribute group",
    attributes={}
)
Parameters:
  • scope (App) –

  • id (str) –

  • applications (Sequence[TargetApplication]) – (experimental) Application associator properties. Default: - Empty array.

Stability:

experimental

Methods

associate_stage(stage)

(experimental) Associate this application with the given stage.

Parameters:

stage (Stage) –

Stability:

experimental

Return type:

Stage

is_stage_associated(stage)

(experimental) Validates if a stage is already associated to the application.

Parameters:

stage (Stage) –

Stability:

experimental

Return type:

bool

to_string()

Returns a string representation of this construct.

Return type:

str

Attributes

app_registry_application

(experimental) Get the AppRegistry application.

Stability:

experimental

node

The tree node.

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.