service_networks
Creates, updates, deletes, gets or lists a service_networks resource.
Overview
| Name | service_networks |
| Type | Resource |
| Id | aws.vpc_lattice.service_networks |
Fields
The following fields are returned by SELECT queries:
- get_service_network
- list_service_networks
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the service network. (pattern: <code>sn-[0-9a-z]{17}</code>) |
name | string | The name of the service network. (pattern: <code>(?![-])(?!.[-]$)(?!.[-]{2})[a-z0-9-]+</code>) |
arn | string | The 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_type | string | The type of IAM policy. (NONE, AWS_IAM) |
created_at | string (date-time) | The date and time that the service network was created, in ISO-8601 format. |
last_updated_at | string (date-time) | The date and time of the last update, in ISO-8601 format. |
number_of_associated_services | integer (int64) | The number of services associated with the service network. |
number_of_associated_vpcs | integer (int64) | The number of VPCs associated with the service network. |
sharing_config | object | Specifies if the service network should be enabled for sharing. |
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the service network. (pattern: <code>sn-[0-9a-z]{17}</code>) |
name | string | The name of the service network. (pattern: <code>(?![-])(?!.[-]$)(?!.[-]{2})[a-z0-9-]+</code>) |
arn | string | The 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>) |
created_at | string (date-time) | The date and time that the service network was created, in ISO-8601 format. |
last_updated_at | string (date-time) | The date and time that the service network was last updated, in ISO-8601 format. |
number_of_associated_resource_configurations | integer (int64) | The number of resource configurations associated with a service network. |
number_of_associated_services | integer (int64) | The number of services associated with the service network. |
number_of_associated_vpcs | integer (int64) | The number of VPCs associated with the service network. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_service_network | select | service_network_identifier, region | Retrieves information about the specified service network. | |
list_service_networks | select | region | maxResults, nextToken | Lists 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_network | insert | region, name | 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. | |
update_service_network | update | service_network_identifier, region, authType | Updates the specified service network. | |
delete_service_network | delete | service_network_identifier, region | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
service_network_identifier | string | The ID or ARN of the service network. |
maxResults | integer | The maximum number of results to return. |
nextToken | string | A pagination token for the next page of results. |
SELECT examples
- get_service_network
- list_service_networks
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
;
Lists the service networks owned by or shared with this account. The account ID in the ARN shows which account owns the service network.
SELECT
id,
name,
arn,
created_at,
last_updated_at,
number_of_associated_resource_configurations,
number_of_associated_services,
number_of_associated_vpcs
FROM aws.vpc_lattice.service_networks
WHERE region = '{{ region }}' -- required
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
INSERT examples
- create_service_network
- Manifest
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
;
# Description fields are for documentation purposes
- name: service_networks
props:
- name: region
value: "{{ region }}"
description: Required parameter for the service_networks resource.
- name: clientToken
value: "{{ clientToken }}"
- name: name
value: "{{ name }}"
- name: authType
value: "{{ authType }}"
valid_values: ['NONE', 'AWS_IAM']
- name: tags
value: "{{ tags }}"
- name: sharingConfig
description: |
Specifies if the service network should be enabled for sharing.
value:
enabled: {{ enabled }}
UPDATE examples
- update_service_network
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
- delete_service_network
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
;