createResourceConfiguration method
- required String name,
- required ResourceConfigurationType type,
- String? clientToken,
- String? customDomainName,
- String? domainVerificationIdentifier,
- String? groupDomain,
- List<
String> ? portRanges, - ProtocolType? protocol,
- ResourceConfigurationDefinition? resourceConfigurationDefinition,
- String? resourceConfigurationGroupIdentifier,
- String? resourceGatewayIdentifier,
- Map<
String, String> ? tags,
Creates a resource configuration. A resource configuration defines a specific resource. You can associate a resource configuration with a service network or a VPC endpoint.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter name :
The name of the resource configuration. The name must be unique within the
account. The valid characters are a-z, 0-9, and hyphens (-). You can't use
a hyphen as the first or last character, or immediately after another
hyphen.
Parameter type :
The type of resource configuration. A resource configuration can be one of
the following types:
- SINGLE - A single resource.
- GROUP - A group of resources. You must create a group resource configuration before you create a child resource configuration.
- CHILD - A single resource that is part of a group resource configuration.
- ARN - An Amazon Web Services resource.
Parameter allowAssociationToShareableServiceNetwork :
(SINGLE, GROUP, ARN) Specifies whether the resource configuration can be
associated with a sharable service network. The default is false.
Parameter clientToken :
A unique, case-sensitive identifier that you provide to ensure the
idempotency of the request. If you retry a request that completed
successfully using the same client token and parameters, the retry
succeeds without performing any actions. If the parameters aren't
identical, the retry fails.
Parameter customDomainName :
A custom domain name for your resource configuration. Additionally,
provide a DomainVerificationID to prove your ownership of a domain.
Parameter domainVerificationIdentifier :
The domain verification ID of your verified custom domain name. If you
don't provide an ID, you must configure the DNS settings yourself.
Parameter groupDomain :
(GROUP) The group domain for a group resource configuration. Any domains
that you create for the child resource are subdomains of the group domain.
Child resources inherit the verification status of the domain.
Parameter portRanges :
(SINGLE, GROUP, CHILD) The TCP port ranges that a consumer can use to
access a resource configuration (for example: 1-65535). You can separate
port ranges using commas (for example: 1,2,22-30).
Parameter protocol :
(SINGLE, GROUP) The protocol accepted by the resource configuration.
Parameter resourceConfigurationDefinition :
Identifies the resource configuration in one of the following ways:
- Amazon Resource Name (ARN) - Supported resource-types that are provisioned by Amazon Web Services services, such as RDS databases, can be identified by their ARN.
- Domain name - Any domain name that is publicly resolvable.
- IP address - For IPv4 and IPv6, only IP addresses in the VPC are supported.
Parameter resourceConfigurationGroupIdentifier :
(CHILD) The ID or ARN of the parent resource configuration of type
GROUP. This is used to associate a child resource
configuration with a group resource configuration.
Parameter resourceGatewayIdentifier :
(SINGLE, GROUP, ARN) The ID or ARN of the resource gateway used to connect
to the resource configuration. For a child resource configuration, this
value is inherited from the parent resource configuration.
Parameter tags :
The tags for the resource configuration.
Implementation
Future<CreateResourceConfigurationResponse> createResourceConfiguration({
required String name,
required ResourceConfigurationType type,
bool? allowAssociationToShareableServiceNetwork,
String? clientToken,
String? customDomainName,
String? domainVerificationIdentifier,
String? groupDomain,
List<String>? portRanges,
ProtocolType? protocol,
ResourceConfigurationDefinition? resourceConfigurationDefinition,
String? resourceConfigurationGroupIdentifier,
String? resourceGatewayIdentifier,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'name': name,
'type': type.value,
if (allowAssociationToShareableServiceNetwork != null)
'allowAssociationToShareableServiceNetwork':
allowAssociationToShareableServiceNetwork,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (customDomainName != null) 'customDomainName': customDomainName,
if (domainVerificationIdentifier != null)
'domainVerificationIdentifier': domainVerificationIdentifier,
if (groupDomain != null) 'groupDomain': groupDomain,
if (portRanges != null) 'portRanges': portRanges,
if (protocol != null) 'protocol': protocol.value,
if (resourceConfigurationDefinition != null)
'resourceConfigurationDefinition': resourceConfigurationDefinition,
if (resourceConfigurationGroupIdentifier != null)
'resourceConfigurationGroupIdentifier':
resourceConfigurationGroupIdentifier,
if (resourceGatewayIdentifier != null)
'resourceGatewayIdentifier': resourceGatewayIdentifier,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/resourceconfigurations',
exceptionFnMap: _exceptionFns,
);
return CreateResourceConfigurationResponse.fromJson(response);
}