Skip to main content

service_networks

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

Overview

Nameservice_networks
TypeResource
Idaws.vpc_lattice.service_networks

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe ID of the service network. (pattern: <code>sn-[0-9a-z]{17}</code>)
namestringThe name of the service network. (pattern: <code>(?![-])(?!.[-]$)(?!.[-]{2})[a-z0-9-]+</code>)
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>)
auth_typestringThe type of IAM policy. (NONE, AWS_IAM)
created_atstring (date-time)The date and time that the service network was created, in ISO-8601 format.
last_updated_atstring (date-time)The date and time of the last update, in ISO-8601 format.
number_of_associated_servicesinteger (int64)The number of services associated with the service network.
number_of_associated_vpcsinteger (int64)The number of VPCs associated with the service network.
sharing_configobjectSpecifies if the service network should be enabled for sharing.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_service_networkselectservice_network_identifier, regionRetrieves information about the specified service network.
list_service_networksselectregionmaxResults, nextTokenLists the service networks owned by or shared with this account. The account ID in the ARN shows which account owns the service network.
create_service_networkinsertregion, nameCreates a service network. A service network is a logical boundary for a collection of services. You can associate services and VPCs with a service network. For more information, see Service networks in the Amazon VPC Lattice User Guide.
update_service_networkupdateservice_network_identifier, region, authTypeUpdates the specified service network.
delete_service_networkdeleteservice_network_identifier, regionDeletes a service network. You can only delete the service network if there is no service or VPC associated with it. If you delete a service network, all resources related to the service network, such as the resource policy, auth policy, and access log subscriptions, are also deleted. For more information, see Delete a service network in the Amazon VPC Lattice User Guide.

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_identifierstringThe ID or ARN of the service network.
maxResultsintegerThe maximum number of results to return.
nextTokenstringA pagination token for the next page of results.

SELECT examples

Retrieves information about the specified service network.

SELECT
id,
name,
arn,
auth_type,
created_at,
last_updated_at,
number_of_associated_services,
number_of_associated_vpcs,
sharing_config
FROM aws.vpc_lattice.service_networks
WHERE service_network_identifier = '{{ service_network_identifier }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a service network. A service network is a logical boundary for a collection of services. You can associate services and VPCs with a service network. For more information, see Service networks in the Amazon VPC Lattice User Guide.

INSERT INTO aws.vpc_lattice.service_networks (
clientToken,
name,
authType,
tags,
sharingConfig,
region
)
SELECT
'{{ clientToken }}',
'{{ name }}' /* required */,
'{{ authType }}',
'{{ tags }}',
'{{ sharingConfig }}',
'{{ region }}'
RETURNING
id,
name,
arn,
auth_type,
sharing_config
;

UPDATE examples

Updates the specified service network.

UPDATE aws.vpc_lattice.service_networks
SET
authType = '{{ authType }}'
WHERE
service_network_identifier = '{{ service_network_identifier }}' --required
AND region = '{{ region }}' --required
AND authType = '{{ authType }}' --required
RETURNING
id,
name,
arn,
auth_type;

DELETE examples

Deletes a service network. You can only delete the service network if there is no service or VPC associated with it. If you delete a service network, all resources related to the service network, such as the resource policy, auth policy, and access log subscriptions, are also deleted. For more information, see Delete a service network in the Amazon VPC Lattice User Guide.

DELETE FROM aws.vpc_lattice.service_networks
WHERE service_network_identifier = '{{ service_network_identifier }}' --required
AND region = '{{ region }}' --required
;