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 | aws.ec2.prefix_lists |
Fields
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. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | PrefixListName, AddressFamily, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all prefix_lists
in a region.
SELECT
region,
prefix_list_name,
prefix_list_id,
owner_id,
address_family,
max_entries,
version,
tags,
entries,
arn
FROM aws.ec2.prefix_lists
WHERE region = 'us-east-1';
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 aws.ec2.prefix_lists
WHERE region = 'us-east-1' AND data__Identifier = '<PrefixListId>';
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 aws.ec2.prefix_lists (
PrefixListName,
AddressFamily,
region
)
SELECT
'{{ PrefixListName }}',
'{{ AddressFamily }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.ec2.prefix_lists (
PrefixListName,
AddressFamily,
MaxEntries,
Tags,
Entries,
region
)
SELECT
'{{ PrefixListName }}',
'{{ AddressFamily }}',
'{{ MaxEntries }}',
'{{ 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: PrefixListName
value: '{{ PrefixListName }}'
- name: AddressFamily
value: '{{ AddressFamily }}'
- name: MaxEntries
value: '{{ MaxEntries }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
- name: Entries
value:
- Cidr: '{{ Cidr }}'
Description: '{{ Description }}'
DELETE
example
/*+ delete */
DELETE FROM aws.ec2.prefix_lists
WHERE data__Identifier = '<PrefixListId>'
AND region = 'us-east-1';
Permissions
To operate on the prefix_lists
resource, the following permissions are required:
Create
EC2:CreateManagedPrefixList,
EC2:DescribeManagedPrefixLists,
EC2:CreateTags
Read
EC2:GetManagedPrefixListEntries,
EC2:DescribeManagedPrefixLists
Update
EC2:DescribeManagedPrefixLists,
EC2:GetManagedPrefixListEntries,
EC2:ModifyManagedPrefixList,
EC2:CreateTags,
EC2:DeleteTags
Delete
EC2:DeleteManagedPrefixList,
EC2:DescribeManagedPrefixLists
List
EC2:DescribeManagedPrefixLists,
EC2:GetManagedPrefixListEntries