createExtension method
Creates an AppConfig extension. An extension augments your ability to inject logic or behavior at different points during the AppConfig workflow of creating or deploying a configuration.
You can create your own extensions or use the Amazon Web Services authored
extensions provided by AppConfig. For an AppConfig extension that uses
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 Web Services 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
Urifield. -
For a custom Amazon SNS notification extension, enter the ARN of an Amazon
SNS topic in the
Urifield. -
For a custom Amazon SQS notification extension, enter the ARN of an Amazon
SQS message queue in the
Urifield.
May throw BadRequestException.
May throw ConflictException.
May throw InternalServerException.
May throw ServiceQuotaExceededException.
Parameter actions :
The actions defined in the extension.
Parameter name :
A name for the extension. Each extension name in your account must be
unique. Extension versions use the same name.
Parameter description :
Information about the extension.
Parameter 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.
Parameter parameters :
The parameters accepted by the extension. You specify parameter values
when you associate the extension to an AppConfig resource by using the
CreateExtensionAssociation API action. For Lambda extension
actions, these parameters are included in the Lambda request object.
Parameter 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.
Implementation
Future<Extension> createExtension({
required Map<ActionPoint, List<Action>> actions,
required String name,
String? description,
int? latestVersionNumber,
Map<String, Parameter>? parameters,
Map<String, String>? tags,
}) async {
final headers = <String, String>{
if (latestVersionNumber != null)
'Latest-Version-Number': latestVersionNumber.toString(),
};
final $payload = <String, dynamic>{
'Actions': actions.map((k, e) => MapEntry(k.value, e)),
'Name': name,
if (description != null) 'Description': description,
if (parameters != null) 'Parameters': parameters,
if (tags != null) 'Tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/extensions',
headers: headers,
exceptionFnMap: _exceptionFns,
);
return Extension.fromJson(response);
}