createServiceTemplate method
Create a service template. The administrator creates a service template to define standardized infrastructure and an optional CI/CD service pipeline. Developers, in turn, select the service template from Proton. If the selected service template includes a service pipeline definition, they provide a link to their source code repository. Proton then deploys and manages the infrastructure defined by the selected service template. For more information, see Proton templates 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 service template.
Parameter description :
A description of the service template.
Parameter displayName :
The name of the service template as displayed in the developer interface.
Parameter encryptionKey :
A customer provided encryption key that's used to encrypt data.
Parameter pipelineProvisioning :
By default, Proton provides a service pipeline for your service. When this
parameter is included, it indicates that an Proton service pipeline
isn't provided for your service. After it's included, it
can't be changed. For more information, see Template
bundles in the Proton User Guide.
Parameter tags :
An optional list of metadata items that you can associate with the Proton
service template. A tag is a key-value pair.
For more information, see Proton resources and tagging in the Proton User Guide.
Implementation
Future<CreateServiceTemplateOutput> createServiceTemplate({
required String name,
String? description,
String? displayName,
String? encryptionKey,
Provisioning? pipelineProvisioning,
List<Tag>? tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'AwsProton20200720.CreateServiceTemplate'
};
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 (pipelineProvisioning != null)
'pipelineProvisioning': pipelineProvisioning.value,
if (tags != null) 'tags': tags,
},
);
return CreateServiceTemplateOutput.fromJson(jsonResponse.body);
}