Skip to content

create_extension_association

create_extension_association(
    extension_identifier: Identifier,
    resource_identifier: Identifier,
    *,
    config_overrides: Optional[AppConfigClientConfig] = None,
    extension_version_number: Optional[Integer] = None,
    parameters: Optional[ParameterValueMap] = None,
    tags: Optional[TagMap] = None,
) -> ExtensionAssociation

When you create an extension or configure an Amazon Web Services authored extension, you associate the extension with an AppConfig application, environment, or configuration profile. For example, you can choose to run the AppConfig deployment events to Amazon SNS Amazon Web Services authored extension and receive notifications on an Amazon SNS topic anytime a configuration deployment is started for a specific application. Defining which extension to associate with an AppConfig resource is called an extension association. An extension association is a specified relationship between an extension and an AppConfig resource, such as an application or a configuration profile. For more information about extensions and associations, see Extending workflows in the AppConfig User Guide.

Parameters:

  • extension_identifier (Identifier) –

    The name, the ID, or the Amazon Resource Name (ARN) of the extension.

  • extension_version_number (Optional[Integer], default: None ) –

    The version number of the extension. If not specified, AppConfig uses the maximum version of the extension.

  • resource_identifier (Identifier) –

    The ARN of an application, configuration profile, or environment.

  • parameters (Optional[ParameterValueMap], default: None ) –

    The parameter names and values defined in the extensions. Extension parameters marked Required must be entered for this field.

  • tags (Optional[TagMap], default: None ) –

    Adds one or more tags for the specified extension association. Tags are metadata that help you categorize resources in different ways, for example, by purpose, owner, or environment. Each tag consists of a key and an optional value, both of which you define.

Raises:

  • BadRequestException –

    The input fails to satisfy the constraints specified by an Amazon Web Services service.

  • InternalServerException –

    There was an internal failure in the AppConfig service.

  • ResourceNotFoundException –

    The requested resource could not be found.

  • ServiceQuotaExceededException –

    The number of one more AppConfig resources exceeds the maximum allowed. Verify that your environment doesn't exceed the following service quotas:

    Applications: 100 max

    To resolve this issue, you can delete one or more resources and try again. Or, you can request a quota increase. For more information about quotas and to request an increase, see Service quotas for AppConfig in the Amazon Web Services General Reference.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_appconfig/_services/app_config.py
def create_extension_association(
    self,
    extension_identifier: "capo_appconfig.types.identifier.Identifier",
    resource_identifier: "capo_appconfig.types.identifier.Identifier",
    *,
    config_overrides: Optional[AppConfigClientConfig] = None,
    extension_version_number: Optional[
        "capo_appconfig.types.integer.Integer"
    ] = None,
    parameters: Optional[
        "capo_appconfig.types.parameter_value_map.ParameterValueMap"
    ] = None,
    tags: Optional["capo_appconfig.types.tag_map.TagMap"] = None,
) -> "capo_appconfig.types.extension_association.ExtensionAssociation":
    """<p>When you create an extension or configure an Amazon Web Services authored extension, you associate the extension with an AppConfig application, environment, or configuration profile. For example, you can choose to run the <code>AppConfig deployment events to Amazon SNS</code> Amazon Web Services authored extension and receive notifications on an Amazon SNS topic anytime a configuration deployment is started for a specific application. Defining which extension to associate with an AppConfig resource is called an <i>extension association</i>. An extension association is a specified relationship between an extension and an AppConfig resource, such as an application or a configuration profile. For more information about extensions and associations, see <a href="https://docs.aws.amazon.com/appconfig/latest/userguide/working-with-appconfig-extensions.html">Extending workflows</a> in the <i>AppConfig User Guide</i>.</p>

    Args:
        extension_identifier: <p>The name, the ID, or the Amazon Resource Name (ARN) of the extension.</p>
        extension_version_number: <p>The version number of the extension. If not specified, AppConfig uses the maximum version of the extension.</p>
        resource_identifier: <p>The ARN of an application, configuration profile, or environment.</p>
        parameters: <p>The parameter names and values defined in the extensions. Extension parameters marked <code>Required</code> must be entered for this field.</p>
        tags: <p>Adds one or more tags for the specified extension association. Tags are metadata that help you categorize resources in different ways, for example, by purpose, owner, or environment. Each tag consists of a key and an optional value, both of which you define. </p>

    Raises:
        capo_appconfig.errors.bad_request_exception.BadRequestException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_appconfig.errors.internal_server_exception.InternalServerException: <p>There was an internal failure in the AppConfig service.</p>
        capo_appconfig.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource could not be found.</p>
        capo_appconfig.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The number of one more AppConfig resources exceeds the maximum allowed. Verify that your environment doesn't exceed the following service quotas:</p> <p>Applications: 100 max</p> <p>To resolve this issue, you can delete one or more resources and try again. Or, you can request a quota increase. For more information about quotas and to request an increase, see <a href="https://docs.aws.amazon.com/general/latest/gr/appconfig.html#limits_appconfig">Service quotas for AppConfig</a> in the Amazon Web Services General Reference.</p>
        capo_appconfig.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_appconfig.types.create_extension_association_request.CreateExtensionAssociationRequest]",
    ) -> OperationResponse[
        "capo_appconfig.types.extension_association.ExtensionAssociation"
    ]:
        import capo_appconfig._operations.amazon_app_config.create_extension_association

        output, http_response = (
            capo_appconfig._operations.amazon_app_config.create_extension_association.create_extension_association(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateExtensionAssociation")
    )
    input_: capo_appconfig.types.create_extension_association_request.CreateExtensionAssociationRequest = {
        "extension_identifier": extension_identifier,
        "resource_identifier": resource_identifier,
    }
    if extension_version_number is not None:
        input_["extension_version_number"] = extension_version_number
    if parameters is not None:
        input_["parameters"] = parameters
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output