createEksAnywhereSubscription method
Creates an EKS Anywhere subscription. When a subscription is created, it is a contract agreement for the length of the term specified in the request. Licenses that are used to validate support are provisioned in Amazon Web Services License Manager and the caller account is granted access to EKS Anywhere Curated Packages.
May throw ClientException.
May throw InvalidParameterException.
May throw ResourceLimitExceededException.
May throw ServerException.
May throw ServiceUnavailableException.
Parameter name :
The unique name for your subscription. It must be unique in your Amazon
Web Services account in the Amazon Web Services Region you're creating the
subscription in. The name can contain only alphanumeric characters
(case-sensitive), hyphens, and underscores. It must start with an
alphabetic character and can't be longer than 100 characters.
Parameter term :
An object representing the term duration and term unit type of your
subscription. This determines the term length of your subscription. Valid
values are MONTHS for term unit and 12 or 36 for term duration, indicating
a 12 month or 36 month subscription. This value cannot be changed after
creating the subscription.
Parameter autoRenew :
A boolean indicating whether the subscription auto renews at the end of
the term.
Parameter clientRequestToken :
A unique, case-sensitive identifier that you provide to ensure the
idempotency of the request.
Parameter licenseQuantity :
The number of licenses to purchase with the subscription. Valid values are
between 1 and 100. This value can't be changed after creating the
subscription.
Parameter licenseType :
The license type for all licenses in the subscription. Valid value is
CLUSTER. With the CLUSTER license type, each license covers support for a
single EKS Anywhere cluster.
Parameter tags :
The metadata for a subscription to assist with categorization and
organization. Each tag consists of a key and an optional value.
Subscription tags don't propagate to any other resources associated with
the subscription.
Implementation
Future<CreateEksAnywhereSubscriptionResponse> createEksAnywhereSubscription({
required String name,
required EksAnywhereSubscriptionTerm term,
bool? autoRenew,
String? clientRequestToken,
int? licenseQuantity,
EksAnywhereSubscriptionLicenseType? licenseType,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'name': name,
'term': term,
if (autoRenew != null) 'autoRenew': autoRenew,
'clientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(),
if (licenseQuantity != null) 'licenseQuantity': licenseQuantity,
if (licenseType != null) 'licenseType': licenseType.value,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/eks-anywhere-subscriptions',
exceptionFnMap: _exceptionFns,
);
return CreateEksAnywhereSubscriptionResponse.fromJson(response);
}