createEnvironmentTemplate method
Create an environment template for Proton. For more information, see Environment Templates in the Proton User Guide.
You can create an environment template in one of the two following ways:
- Register and publish a standard environment template that instructs Proton to deploy and manage environment infrastructure.
-
Register and publish a customer managed environment template that
connects Proton to your existing provisioned infrastructure that you
manage. Proton doesn't manage your existing provisioned
infrastructure. To create an environment template for customer provisioned
and managed infrastructure, include the
provisioningparameter and set the value toCUSTOMER_MANAGED. For more information, see Register and publish an environment template in the Proton User Guide.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter name :
The name of the environment template.
Parameter description :
A description of the environment template.
Parameter displayName :
The environment template name as displayed in the developer interface.
Parameter encryptionKey :
A customer provided encryption key that Proton uses to encrypt data.
Parameter provisioning :
When included, indicates that the environment template is for customer
provisioned and managed infrastructure.
Parameter tags :
An optional list of metadata items that you can associate with the Proton
environment template. A tag is a key-value pair.
For more information, see Proton resources and tagging in the Proton User Guide.
Implementation
Future<CreateEnvironmentTemplateOutput> createEnvironmentTemplate({
required String name,
String? description,
String? displayName,
String? encryptionKey,
Provisioning? provisioning,
List<Tag>? tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'AwsProton20200720.CreateEnvironmentTemplate'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'name': name,
if (description != null) 'description': description,
if (displayName != null) 'displayName': displayName,
if (encryptionKey != null) 'encryptionKey': encryptionKey,
if (provisioning != null) 'provisioning': provisioning.value,
if (tags != null) 'tags': tags,
},
);
return CreateEnvironmentTemplateOutput.fromJson(jsonResponse.body);
}