CreateExtension - Amazon AppConfig
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

CreateExtension

Creates an Amazon AppConfig extension. An extension augments your ability to inject logic or behavior at different points during the Amazon AppConfig workflow of creating or deploying a configuration.

You can create your own extensions or use the Amazon authored extensions provided by Amazon AppConfig. For an Amazon AppConfig extension that uses Amazon Lambda, you must create a Lambda function to perform any computation and processing defined in the extension. If you plan to create custom versions of the Amazon authored notification extensions, you only need to specify an Amazon Resource Name (ARN) in the Uri field for the new extension version.

  • For a custom EventBridge notification extension, enter the ARN of the EventBridge default events in the Uri field.

  • For a custom Amazon SNS notification extension, enter the ARN of an Amazon SNS topic in the Uri field.

  • For a custom Amazon SQS notification extension, enter the ARN of an Amazon SQS message queue in the Uri field.

For more information about extensions, see Extending workflows in the Amazon AppConfig User Guide.

Request Syntax

POST /extensions HTTP/1.1 Latest-Version-Number: LatestVersionNumber Content-type: application/json { "Actions": { "string" : [ { "Description": "string", "Name": "string", "RoleArn": "string", "Uri": "string" } ] }, "Description": "string", "Name": "string", "Parameters": { "string" : { "Description": "string", "Dynamic": boolean, "Required": boolean } }, "Tags": { "string" : "string" } }

URI Request Parameters

The request uses the following URI parameters.

LatestVersionNumber

You can omit this field when you create an 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.

Request Body

The request accepts the following data in JSON format.

Actions

The actions defined in the extension.

Type: String to array of Action objects map

Map Entries: Maximum number of 5 items.

Valid Keys: PRE_CREATE_HOSTED_CONFIGURATION_VERSION | PRE_START_DEPLOYMENT | ON_DEPLOYMENT_START | ON_DEPLOYMENT_STEP | ON_DEPLOYMENT_BAKING | ON_DEPLOYMENT_COMPLETE | ON_DEPLOYMENT_ROLLED_BACK

Array Members: Fixed number of 1 item.

Required: Yes

Description

Information about the extension.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 1024.

Required: No

Name

A name for the extension. Each extension name in your account must be unique. Extension versions use the same name.

Type: String

Pattern: ^[^\/#:\n]{1,64}$

Required: Yes

Parameters

The parameters accepted by the extension. You specify parameter values when you associate the extension to an Amazon AppConfig resource by using the CreateExtensionAssociation API action. For Amazon Lambda extension actions, these parameters are included in the Lambda request object.

Type: String to Parameter object map

Map Entries: Maximum number of 10 items.

Key Pattern: ^[^\/#:\n]{1,64}$

Required: No

Tags

Adds one or more tags for the specified extension. 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.

Type: String to string map

Map Entries: Minimum number of 0 items. Maximum number of 50 items.

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Value Length Constraints: Maximum length of 256.

Required: No

Response Syntax

HTTP/1.1 201 Content-type: application/json { "Actions": { "string" : [ { "Description": "string", "Name": "string", "RoleArn": "string", "Uri": "string" } ] }, "Arn": "string", "Description": "string", "Id": "string", "Name": "string", "Parameters": { "string" : { "Description": "string", "Dynamic": boolean, "Required": boolean } }, "VersionNumber": number }

Response Elements

If the action is successful, the service sends back an HTTP 201 response.

The following data is returned in JSON format by the service.

Actions

The actions defined in the extension.

Type: String to array of Action objects map

Map Entries: Maximum number of 5 items.

Valid Keys: PRE_CREATE_HOSTED_CONFIGURATION_VERSION | PRE_START_DEPLOYMENT | ON_DEPLOYMENT_START | ON_DEPLOYMENT_STEP | ON_DEPLOYMENT_BAKING | ON_DEPLOYMENT_COMPLETE | ON_DEPLOYMENT_ROLLED_BACK

Array Members: Fixed number of 1 item.

Arn

The system-generated Amazon Resource Name (ARN) for the extension.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 2048.

Pattern: arn:(aws[a-zA-Z-]*)?:[a-z]+:([a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1})?:(\d{12})?:[a-zA-Z0-9-_/:.]+

Description

Information about the extension.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 1024.

Id

The system-generated ID of the extension.

Type: String

Pattern: [a-z0-9]{4,7}

Name

The extension name.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Parameters

The parameters accepted by the extension. You specify parameter values when you associate the extension to an Amazon AppConfig resource by using the CreateExtensionAssociation API action. For Amazon Lambda extension actions, these parameters are included in the Lambda request object.

Type: String to Parameter object map

Map Entries: Maximum number of 10 items.

Key Pattern: ^[^\/#:\n]{1,64}$

VersionNumber

The extension version number.

Type: Integer

Errors

For information about the errors that are common to all actions, see Common Errors.

BadRequestException

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

HTTP Status Code: 400

ConflictException

The request could not be processed because of conflict in the current state of the resource.

HTTP Status Code: 409

InternalServerException

There was an internal failure in the Amazon AppConfig service.

HTTP Status Code: 500

ServiceQuotaExceededException

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

Applications: 100 max

Deployment strategies: 20 max

Configuration profiles: 100 max per application

Environments: 20 max per application

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 Amazon AppConfig in the Amazon Web Services General Reference.

HTTP Status Code: 402

Examples

Example

This example illustrates one usage of CreateExtension.

Sample Request

POST /extensions HTTP/1.1 Host: appconfig.us-west-2.amazonaws.com Accept-Encoding: identity Content-Type: application/json User-Agent: aws-cli/2.7.19 Python/3.9.11 Windows/10 exe/AMD64 prompt/off command/appconfig.create-extension X-Amz-Date: 20220803T202954Z Authorization: AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE/20220803/us-west-2/appconfig/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=39c3b3042cd2aEXAMPLE Content-Length: 304 { "Name": "my-test-extension", "Actions": { "PRE_CREATE_HOSTED_CONFIGURATION_VERSION": [{ "Name": "S3backup", "Uri": "arn:aws:lambda:us-west-2:111122223333:function:mytestfunction", "RoleArn": "arn:aws:iam::111122223333:role/mytestextensionrole" }] }, "Parameters": { "MyParamKey": { "Required": true } } }

Sample Response

{ "Actions": { "PRE_CREATE_HOSTED_CONFIGURATION_VERSION": [{ "Description": null, "Name": "S3backup", "RoleArn": "arn:aws:iam::111122223333:role/mytestextensionrole", "Uri": "arn:aws:lambda:us-west-2:111122223333:function:mytestfunction" }] }

See Also

For more information about using this API in one of the language-specific Amazon SDKs, see the following: