prefix_lists
Creates, updates, deletes or gets a prefix_list resource or lists prefix_lists in a region
Overview
| Name | prefix_lists |
| Type | Resource |
| Description | Resource schema of AWS::EC2::PrefixList Type |
| Id | awscc.ec2.prefix_lists |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
prefix_list_name | string | Name of Prefix List. |
prefix_list_id | string | Id of Prefix List. |
owner_id | string | Owner Id of Prefix List. |
address_family | string | Ip Version of Prefix List. |
max_entries | integer | Max Entries of Prefix List. |
version | integer | Version of Prefix List. |
tags | array | Tags for Prefix List |
entries | array | Entries of Prefix List. |
arn | string | The Amazon Resource Name (ARN) of the Prefix List. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
prefix_list_id | string | Id of Prefix List. |
region | string | AWS region. |
For more information, see AWS::EC2::PrefixList.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | prefix_lists | INSERT | PrefixListName, AddressFamily, region |
delete_resource | prefix_lists | DELETE | Identifier, region |
update_resource | prefix_lists | UPDATE | Identifier, PatchDocument, region |
list_resources | prefix_lists_list_only | SELECT | region |
get_resource | prefix_lists | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual prefix_list.
SELECT
region,
prefix_list_name,
prefix_list_id,
owner_id,
address_family,
max_entries,
version,
tags,
entries,
arn
FROM awscc.ec2.prefix_lists
WHERE
region = '{{ region }}' AND
Identifier = '{{ prefix_list_id }}';
Lists all prefix_lists in a region.
SELECT
region,
prefix_list_id
FROM awscc.ec2.prefix_lists_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new prefix_list resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.ec2.prefix_lists (
PrefixListName,
AddressFamily,
region
)
SELECT
'{{ prefix_list_name }}',
'{{ address_family }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.ec2.prefix_lists (
PrefixListName,
AddressFamily,
MaxEntries,
Tags,
Entries,
region
)
SELECT
'{{ prefix_list_name }}',
'{{ address_family }}',
'{{ max_entries }}',
'{{ tags }}',
'{{ entries }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: prefix_list
props:
- name: prefix_list_name
value: '{{ prefix_list_name }}'
- name: address_family
value: '{{ address_family }}'
- name: max_entries
value: '{{ max_entries }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
- name: entries
value:
- cidr: '{{ cidr }}'
description: '{{ description }}'
UPDATE example
Use the following StackQL query and manifest file to update a prefix_list resource, using stack-deploy.
/*+ update */
UPDATE awscc.ec2.prefix_lists
SET PatchDocument = string('{{ {
"PrefixListName": prefix_list_name,
"AddressFamily": address_family,
"MaxEntries": max_entries,
"Tags": tags,
"Entries": entries
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ prefix_list_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.ec2.prefix_lists
WHERE
Identifier = '{{ prefix_list_id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the prefix_lists resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
EC2:CreateManagedPrefixList,
EC2:DescribeManagedPrefixLists,
EC2:CreateTags
EC2:GetManagedPrefixListEntries,
EC2:DescribeManagedPrefixLists
EC2:DescribeManagedPrefixLists,
EC2:GetManagedPrefixListEntries,
EC2:ModifyManagedPrefixList,
EC2:CreateTags,
EC2:DeleteTags
EC2:DeleteManagedPrefixList,
EC2:DescribeManagedPrefixLists
EC2:DescribeManagedPrefixLists,
EC2:GetManagedPrefixListEntries