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 = 'us-east-1' 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 = 'us-east-1';
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 }}';
/*+ create */
INSERT INTO awscc.ec2.prefix_lists (
PrefixListName,
AddressFamily,
MaxEntries,
Tags,
Entries,
region
)
SELECT
'{{ prefix_list_name }}',
'{{ address_family }}',
'{{ max_entries }}',
'{{ tags }}',
'{{ entries }}',
'{{ region }}';
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 }}';
DELETE example
/*+ delete */
DELETE FROM awscc.ec2.prefix_lists
WHERE
Identifier = '{{ prefix_list_id }}' AND
region = 'us-east-1';
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