Skip to main content

auth_policies

Creates, updates, deletes, gets or lists an auth_policies resource.

Overview

Nameauth_policies
TypeResource
Idaws.vpc_lattice.auth_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
created_atstring (date-time)The date and time that the auth policy was created, in ISO-8601 format.
last_updated_atstring (date-time)The date and time that the auth policy was last updated, in ISO-8601 format.
policystringThe auth policy.
statestringThe state of the auth policy. The auth policy is only active when the auth type is set to AWS_IAM. If you provide a policy, then authentication and authorization decisions are made based on this policy and the client's IAM policy. If the auth type is NONE, then any auth policy that you provide remains inactive. For more information, see Create a service network in the Amazon VPC Lattice User Guide. (Active, Inactive)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_auth_policyselectresource_identifier, regionRetrieves information about the auth policy for the specified service or service network.
put_auth_policyreplaceresource_identifier, region, policyCreates or updates the auth policy. The policy string in JSON must not contain newlines or blank lines. For more information, see Auth policies in the Amazon VPC Lattice User Guide.
delete_auth_policydeleteresource_identifier, regionDeletes the specified auth policy. If an auth is set to AWS_IAM and the auth policy is deleted, all requests are denied. If you are trying to remove the auth policy completely, you must set the auth type to NONE. If auth is enabled on the resource, but no auth policy is set, all requests are denied.

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)
resource_identifierstringThe ID or ARN of the resource.

SELECT examples

Retrieves information about the auth policy for the specified service or service network.

SELECT
created_at,
last_updated_at,
policy,
state
FROM aws.vpc_lattice.auth_policies
WHERE resource_identifier = '{{ resource_identifier }}' -- required
AND region = '{{ region }}' -- required
;

REPLACE examples

Creates or updates the auth policy. The policy string in JSON must not contain newlines or blank lines. For more information, see Auth policies in the Amazon VPC Lattice User Guide.

REPLACE aws.vpc_lattice.auth_policies
SET
policy = '{{ policy }}'
WHERE
resource_identifier = '{{ resource_identifier }}' --required
AND region = '{{ region }}' --required
AND policy = '{{ policy }}' --required
RETURNING
policy,
state;

DELETE examples

Deletes the specified auth policy. If an auth is set to AWS_IAM and the auth policy is deleted, all requests are denied. If you are trying to remove the auth policy completely, you must set the auth type to NONE. If auth is enabled on the resource, but no auth policy is set, all requests are denied.

DELETE FROM aws.vpc_lattice.auth_policies
WHERE resource_identifier = '{{ resource_identifier }}' --required
AND region = '{{ region }}' --required
;