createDistributionTenant method
Creates a distribution tenant.
May throw AccessDenied.
May throw CNAMEAlreadyExists.
May throw EntityAlreadyExists.
May throw EntityLimitExceeded.
May throw EntityNotFound.
May throw InvalidArgument.
May throw InvalidAssociation.
May throw InvalidTagging.
Parameter distributionId :
The ID of the multi-tenant distribution to use for creating the
distribution tenant.
Parameter domains :
The domains associated with the distribution tenant. You must specify at
least one domain in the request.
Parameter name :
The name of the distribution tenant. Enter a friendly identifier that is
unique within your Amazon Web Services account. This name can't be updated
after you create the distribution tenant.
Parameter connectionGroupId :
The ID of the connection group to associate with the distribution tenant.
Parameter customizations :
Customizations for the distribution tenant. For each distribution tenant,
you can specify the geographic restrictions, and the Amazon Resource Names
(ARNs) for the ACM certificate and WAF web ACL. These are specific values
that you can override or disable from the multi-tenant distribution that
was used to create the distribution tenant.
Parameter enabled :
Indicates whether the distribution tenant should be enabled when created.
If the distribution tenant is disabled, the distribution tenant won't
serve traffic.
Parameter managedCertificateRequest :
The configuration for the CloudFront managed ACM certificate request.
Parameter parameters :
A list of parameter values to add to the resource. A parameter is
specified as a key-value pair. A valid parameter value must exist for any
parameter that is marked as required in the multi-tenant distribution.
Implementation
Future<CreateDistributionTenantResult> createDistributionTenant({
required String distributionId,
required List<DomainItem> domains,
required String name,
String? connectionGroupId,
Customizations? customizations,
bool? enabled,
ManagedCertificateRequest? managedCertificateRequest,
List<Parameter>? parameters,
Tags? tags,
}) async {
final $result = await _protocol.sendRaw(
method: 'POST',
requestUri: '/2020-05-31/distribution-tenant',
payload: CreateDistributionTenantRequest(
distributionId: distributionId,
domains: domains,
name: name,
connectionGroupId: connectionGroupId,
customizations: customizations,
enabled: enabled,
managedCertificateRequest: managedCertificateRequest,
parameters: parameters,
tags: tags)
.toXml('CreateDistributionTenantRequest'),
exceptionFnMap: _exceptionFns,
);
final $elem = await _s.xmlFromResponse($result);
return CreateDistributionTenantResult(
distributionTenant: DistributionTenant.fromXml($elem),
eTag: _s.extractHeaderStringValue($result.headers, 'ETag'),
);
}