auth_policies
Creates, updates, deletes, gets or lists an auth_policies resource.
Overview
| Name | auth_policies |
| Type | Resource |
| Id | aws.vpc_lattice.auth_policies |
Fields
The following fields are returned by SELECT queries:
- get_auth_policy
| Name | Datatype | Description |
|---|---|---|
created_at | string (date-time) | The date and time that the auth policy was created, in ISO-8601 format. |
last_updated_at | string (date-time) | The date and time that the auth policy was last updated, in ISO-8601 format. |
policy | string | The auth policy. |
state | string | The 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_auth_policy | select | resource_identifier, region | Retrieves information about the auth policy for the specified service or service network. | |
put_auth_policy | replace | resource_identifier, region, policy | 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. | |
delete_auth_policy | delete | resource_identifier, region | 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. |
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) |
resource_identifier | string | The ID or ARN of the resource. |
SELECT examples
- get_auth_policy
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
- put_auth_policy
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
- delete_auth_policy
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
;