Step 4: Create an extension association for a custom Amazon AppConfig extension
To create an extension, or configure an Amazon authored extension, you define the action
points that invoke an extension when a specific Amazon AppConfig resource is used. For example, you
can choose to run the Amazon AppConfig deployment events to Amazon SNS
extension and receive
notifications on an Amazon SNS topic anytime a configuration deployment is started for a specific
application. Defining which action points invoke an extension for a specific Amazon AppConfig resource
is called an extension association. An extension association is a
specified relationship between an extension and an Amazon AppConfig resource, such as an
application or a configuration profile.
A single Amazon AppConfig application can include multiple environments and configuration profiles. If you associate an extension to an application or an environment, Amazon AppConfig invokes the extension for any workflows that relate to the application or environment resources, if applicable.
For example, say you have an Amazon AppConfig application called MobileApps that includes a configuration profile called AccessList. And say the MobileApps application includes Beta, Integration, and Production environments. You create an extension association for the Amazon authored Amazon SNS notification extension and associate the extension to the MobileApps application. The Amazon SNS notification extension is invoked anytime the configuration is deployed for the application to any of the three environments.
Use the following procedures to create an Amazon AppConfig extension association by using the Amazon AppConfig console.
To create an extension association (console)
Open the Amazon Systems Manager console at https://console.amazonaws.cn/systems-manager/appconfig/
. -
In the navigation pane, choose Amazon AppConfig.
-
On the Extensions tab, choose an option button for an extension and then choose Add to resource. For the purposes of this walkthrough, choose MyS3ConfigurationBackUpExtension.
-
In the Extension resource details section, for Resource type, choose an Amazon AppConfig resource type. Depending on the resource you choose, Amazon AppConfig prompts you to choose other resources. For the purposes of this walkthrough, choose Application.
-
Choose an application in the list.
-
In the Parameters section, verify that S3_BUCKET is listed in the Key field. In the Value field, paste the ARN of the Lambda extensions. For example:
arn:aws-cn:lambda:
.aws-region
:111122223333:function:MyS3ConfigurationBackUpExtension -
Choose Create association to resource.
After you create the association, you can invoke the
MyS3ConfigurationBackUpExtension
extension by creating a new configuration
profile that specifies hosted
for its SourceUri
. As a part of the
workflow to create the new configuration, Amazon AppConfig encounters the
PRE_CREATE_HOSTED_CONFIGURATION_VERSION
action point. Encountering this
action point invokes the MyS3ConfigurationBackUpExtension
extension, which
automatically backs up the newly created configuration to the S3 bucket specified in the
Parameter
section of the extension association.