Skip to main content

service_network_service_associations

Creates, updates, deletes, gets or lists a service_network_service_associations resource.

Overview

Nameservice_network_service_associations
TypeResource
Idaws.vpc_lattice.service_network_service_associations

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe ID of the service network and service association. (pattern: <code>((snsa-[0-9a-z]{17})|(arn:[a-z0-9-]+:vpc-lattice:[a-zA-Z0-9-]+:\d{12}:servicenetworkserviceassociation/snsa-[0-9a-z]{17}))</code>)
arnstringThe Amazon Resource Name (ARN) of the association. (pattern: <code>arn:[a-z0-9-]+:vpc-lattice:[a-zA-Z0-9-]+:\d{12}:servicenetworkserviceassociation/snsa-[0-9a-z]{17}</code>)
created_atstring (date-time)The date and time that the association was created, in ISO-8601 format.
created_bystringThe account that created the association. (pattern: <code>[0-9]{12}</code>)
custom_domain_namestringThe custom domain name of the service.
dns_entryobjectThe DNS name of the service.
failure_codestringThe failure code.
failure_messagestringThe failure message.
service_arnstringThe Amazon Resource Name (ARN) of the service. (pattern: <code>arn:[a-z0-9-]+:vpc-lattice:[a-zA-Z0-9-]+:\d{12}:service/svc-[0-9a-z]{17}</code>)
service_idstringThe ID of the service. (pattern: <code>svc-[0-9a-z]{17}</code>)
service_namestringThe name of the service. (pattern: <code>(?!svc-)(?![-])(?!.[-]$)(?!.[-]{2})[a-z0-9-]+</code>)
service_network_arnstringThe Amazon Resource Name (ARN) of the service network. (pattern: <code>arn:[a-z0-9-]+:vpc-lattice:[a-zA-Z0-9-]+:\d{12}:servicenetwork/sn-[0-9a-z]{17}</code>)
service_network_idstringThe ID of the service network. (pattern: <code>sn-[0-9a-z]{17}</code>)
service_network_namestringThe name of the service network. (pattern: <code>(?![-])(?!.[-]$)(?!.[-]{2})[a-z0-9-]+</code>)
statusstringThe status of the association. (CREATE_IN_PROGRESS, ACTIVE, DELETE_IN_PROGRESS, CREATE_FAILED, DELETE_FAILED)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_service_network_service_associationselectservice_network_service_association_identifier, regionRetrieves information about the specified association between a service network and a service.
list_service_network_service_associationsselectregionserviceNetworkIdentifier, serviceIdentifier, maxResults, nextTokenLists the associations between a service network and a service. You can filter the list either by service or service network. You must provide either the service network identifier or the service identifier. Every association in Amazon VPC Lattice has a unique Amazon Resource Name (ARN), such as when a service network is associated with a VPC or when a service is associated with a service network. If the association is for a resource is shared with another account, the association includes the local account ID as the prefix in the ARN.
create_service_network_service_associationinsertregion, serviceIdentifier, serviceNetworkIdentifierAssociates the specified service with the specified service network. For more information, see Manage service associations in the Amazon VPC Lattice User Guide. You can't use this operation if the service and service network are already associated or if there is a disassociation or deletion in progress. If the association fails, you can retry the operation by deleting the association and recreating it. You cannot associate a service and service network that are shared with a caller. The caller must own either the service or the service network. As a result of this operation, the association is created in the service network account and the association owner account.
delete_service_network_service_associationdeleteservice_network_service_association_identifier, regionDeletes the association between a service and a service network. This operation fails if an association is still in progress.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)
service_network_service_association_identifierstringThe ID or ARN of the association.
maxResultsintegerThe maximum number of results to return.
nextTokenstringA pagination token for the next page of results.
serviceIdentifierstringThe ID or ARN of the service.
serviceNetworkIdentifierstringThe ID or ARN of the service network.

SELECT examples

Retrieves information about the specified association between a service network and a service.

SELECT
id,
arn,
created_at,
created_by,
custom_domain_name,
dns_entry,
failure_code,
failure_message,
service_arn,
service_id,
service_name,
service_network_arn,
service_network_id,
service_network_name,
status
FROM aws.vpc_lattice.service_network_service_associations
WHERE service_network_service_association_identifier = '{{ service_network_service_association_identifier }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Associates the specified service with the specified service network. For more information, see Manage service associations in the Amazon VPC Lattice User Guide. You can't use this operation if the service and service network are already associated or if there is a disassociation or deletion in progress. If the association fails, you can retry the operation by deleting the association and recreating it. You cannot associate a service and service network that are shared with a caller. The caller must own either the service or the service network. As a result of this operation, the association is created in the service network account and the association owner account.

INSERT INTO aws.vpc_lattice.service_network_service_associations (
clientToken,
serviceIdentifier,
serviceNetworkIdentifier,
tags,
region
)
SELECT
'{{ clientToken }}',
'{{ serviceIdentifier }}' /* required */,
'{{ serviceNetworkIdentifier }}' /* required */,
'{{ tags }}',
'{{ region }}'
RETURNING
id,
arn,
created_by,
custom_domain_name,
dns_entry,
status
;

DELETE examples

Deletes the association between a service and a service network. This operation fails if an association is still in progress.

DELETE FROM aws.vpc_lattice.service_network_service_associations
WHERE service_network_service_association_identifier = '{{ service_network_service_association_identifier }}' --required
AND region = '{{ region }}' --required
;