managed_prefix_lists
Creates, updates, deletes, gets or lists a managed_prefix_lists resource.
Overview
| Name | managed_prefix_lists |
| Type | Resource |
| Id | aws.ec2.managed_prefix_lists |
Fields
The following fields are returned by SELECT queries:
- describe_managed_prefix_lists
| Name | Datatype | Description |
|---|---|---|
address_family | string | The IP address version. |
ipam_prefix_list_resolver_sync_enabled | boolean | Indicates whether synchronization with an IPAM prefix list resolver is enabled for this managed prefix list. When enabled, the prefix list CIDRs are automatically updated based on the resolver's CIDR selection rules. |
ipam_prefix_list_resolver_target_id | string | The ID of the IPAM prefix list resolver target associated with this managed prefix list. When set, this prefix list becomes an IPAM managed prefix list. An IPAM-managed prefix list is a customer-managed prefix list that has been associated with an IPAM prefix list resolver target. When a prefix list becomes IPAM managed, its CIDRs are automatically synchronized based on the IPAM prefix list resolver's CIDR selection rules, and direct CIDR modifications are restricted. |
max_entries | integer | The maximum number of entries for the prefix list. |
owner_id | string | The ID of the owner of the prefix list. |
prefix_list_arn | string | The Amazon Resource Name (ARN) for the prefix list. |
prefix_list_id | string | The ID of the prefix list. |
prefix_list_name | string | The name of the prefix list. |
state | string | The current state of the prefix list. |
state_message | string | The state message. |
tags | string | The tags for the prefix list. |
version | integer | The version of the prefix list. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_managed_prefix_lists | select | region | DryRun, Filter, MaxResults, NextToken, PrefixListId | Describes your managed prefix lists and any Amazon Web Services-managed prefix lists. |
create_managed_prefix_list | insert | PrefixListName, MaxEntries, AddressFamily, region | DryRun, Entry, TagSpecification, ClientToken | Creates a managed prefix list. You can specify entries for the prefix list. Each entry consists of a CIDR block and an optional description. |
modify_managed_prefix_list | update | PrefixListId, region | DryRun, CurrentVersion, PrefixListName, AddEntry, RemoveEntry, MaxEntries, IpamPrefixListResolverSyncEnabled | Modifies the specified managed prefix list. Adding or removing entries in a prefix list creates a new version of the prefix list. Changing the name of the prefix list does not affect the version. If you specify a current version number that does not match the true current version number, the request fails. |
delete_managed_prefix_list | delete | PrefixListId, region | DryRun | Deletes the specified managed prefix list. You must first remove all references to the prefix list in your resources. |
restore_managed_prefix_list_version | exec | PrefixListId, PreviousVersion, CurrentVersion, region | DryRun | Restores the entries from a previous version of a managed prefix list to a new version of the prefix list. |
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 |
|---|---|---|
AddressFamily | string | The IP address type. Valid Values: IPv4 | IPv6 |
CurrentVersion | integer (int64) | The current version number for the prefix list. |
MaxEntries | integer | The maximum number of entries for the prefix list. |
PrefixListId | string | The ID of the prefix list. |
PrefixListName | string | A name for the prefix list. Constraints: Up to 255 characters in length. The name cannot start with com.amazonaws. |
PreviousVersion | integer (int64) | The version to restore. |
region | string | AWS region (default: us-east-1) |
AddEntry | array | One or more entries to add to the prefix list. |
ClientToken | string | Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see Ensuring idempotency. Constraints: Up to 255 UTF-8 characters in length. |
CurrentVersion | integer (int64) | The current version of the prefix list. |
DryRun | boolean | Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation. |
Entry | array | One or more entries for the prefix list. |
Filter | array | One or more filters. owner-id - The ID of the prefix list owner. prefix-list-id - The ID of the prefix list. prefix-list-name - The name of the prefix list. |
IpamPrefixListResolverSyncEnabled | boolean | Indicates whether synchronization with an IPAM prefix list resolver should be enabled for this managed prefix list. When enabled, the prefix list CIDRs are automatically updated based on the associated resolver's CIDR selection rules. |
MaxEntries | integer | The maximum number of entries for the prefix list. You cannot modify the entries of a prefix list and modify the size of a prefix list at the same time. If any of the resources that reference the prefix list cannot support the new maximum size, the modify operation fails. Check the state message for the IDs of the first ten resources that do not support the new maximum size. |
MaxResults | integer | The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value. |
NextToken | string | The token for the next page of results. |
PrefixListId | array | One or more prefix list IDs. |
PrefixListName | string | A name for the prefix list. |
RemoveEntry | array | One or more entries to remove from the prefix list. |
TagSpecification | array | The tags to apply to the prefix list during creation. |
SELECT examples
- describe_managed_prefix_lists
Describes your managed prefix lists and any Amazon Web Services-managed prefix lists.
SELECT
address_family,
ipam_prefix_list_resolver_sync_enabled,
ipam_prefix_list_resolver_target_id,
max_entries,
owner_id,
prefix_list_arn,
prefix_list_id,
prefix_list_name,
state,
state_message,
tags,
version
FROM aws.ec2.managed_prefix_lists
WHERE region = '{{ region }}' -- required
AND DryRun = '{{ DryRun }}'
AND Filter = '{{ Filter }}'
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
AND PrefixListId = '{{ PrefixListId }}'
;
INSERT examples
- create_managed_prefix_list
- Manifest
Creates a managed prefix list. You can specify entries for the prefix list. Each entry consists of a CIDR block and an optional description.
INSERT INTO aws.ec2.managed_prefix_lists (
PrefixListName,
MaxEntries,
AddressFamily,
region,
DryRun,
Entry,
TagSpecification,
ClientToken
)
SELECT
'{{ PrefixListName }}',
'{{ MaxEntries }}',
'{{ AddressFamily }}',
'{{ region }}',
'{{ DryRun }}',
'{{ Entry }}',
'{{ TagSpecification }}',
'{{ ClientToken }}'
RETURNING
address_family,
ipam_prefix_list_resolver_sync_enabled,
ipam_prefix_list_resolver_target_id,
max_entries,
owner_id,
prefix_list_arn,
prefix_list_id,
prefix_list_name,
state,
state_message,
tags,
version
;
# Description fields are for documentation purposes
- name: managed_prefix_lists
props:
- name: PrefixListName
value: "{{ PrefixListName }}"
description: Required parameter for the managed_prefix_lists resource.
- name: MaxEntries
value: {{ MaxEntries }}
description: Required parameter for the managed_prefix_lists resource.
- name: AddressFamily
value: "{{ AddressFamily }}"
description: Required parameter for the managed_prefix_lists resource.
- name: region
value: "{{ region }}"
description: Required parameter for the managed_prefix_lists resource.
- name: DryRun
value: {{ DryRun }}
description: Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
description: Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
- name: Entry
value: "{{ Entry }}"
description: One or more entries for the prefix list.
description: One or more entries for the prefix list.
- name: TagSpecification
value: "{{ TagSpecification }}"
description: The tags to apply to the prefix list during creation.
description: The tags to apply to the prefix list during creation.
- name: ClientToken
value: "{{ ClientToken }}"
description: Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see Ensuring idempotency. Constraints: Up to 255 UTF-8 characters in length.
description: Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see Ensuring idempotency. Constraints: Up to 255 UTF-8 characters in length.
UPDATE examples
- modify_managed_prefix_list
Modifies the specified managed prefix list. Adding or removing entries in a prefix list creates a new version of the prefix list. Changing the name of the prefix list does not affect the version. If you specify a current version number that does not match the true current version number, the request fails.
UPDATE aws.ec2.managed_prefix_lists
SET
-- No updatable properties
WHERE
PrefixListId = '{{ PrefixListId }}' --required
AND region = '{{ region }}' --required
AND DryRun = {{ DryRun}}
AND CurrentVersion = '{{ CurrentVersion}}'
AND PrefixListName = '{{ PrefixListName}}'
AND AddEntry = '{{ AddEntry}}'
AND RemoveEntry = '{{ RemoveEntry}}'
AND MaxEntries = '{{ MaxEntries}}'
AND IpamPrefixListResolverSyncEnabled = {{ IpamPrefixListResolverSyncEnabled}}
RETURNING
address_family,
ipam_prefix_list_resolver_sync_enabled,
ipam_prefix_list_resolver_target_id,
max_entries,
owner_id,
prefix_list_arn,
prefix_list_id,
prefix_list_name,
state,
state_message,
tags,
version;
DELETE examples
- delete_managed_prefix_list
Deletes the specified managed prefix list. You must first remove all references to the prefix list in your resources.
DELETE FROM aws.ec2.managed_prefix_lists
WHERE PrefixListId = '{{ PrefixListId }}' --required
AND region = '{{ region }}' --required
AND DryRun = '{{ DryRun }}'
;
Lifecycle Methods
- restore_managed_prefix_list_version
Restores the entries from a previous version of a managed prefix list to a new version of the prefix list.
EXEC aws.ec2.managed_prefix_lists.restore_managed_prefix_list_version
@PrefixListId='{{ PrefixListId }}' --required,
@PreviousVersion='{{ PreviousVersion }}' --required,
@CurrentVersion='{{ CurrentVersion }}' --required,
@region='{{ region }}' --required,
@DryRun={{ DryRun }}
;