Skip to main content

managed_prefix_lists

Creates, updates, deletes, gets or lists a managed_prefix_lists resource.

Overview

Namemanaged_prefix_lists
TypeResource
Idaws.ec2.managed_prefix_lists

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
address_familystringThe IP address version.
ipam_prefix_list_resolver_sync_enabledbooleanIndicates 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_idstringThe 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_entriesintegerThe maximum number of entries for the prefix list.
owner_idstringThe ID of the owner of the prefix list.
prefix_list_arnstringThe Amazon Resource Name (ARN) for the prefix list.
prefix_list_idstringThe ID of the prefix list.
prefix_list_namestringThe name of the prefix list.
statestringThe current state of the prefix list.
state_messagestringThe state message.
tagsstringThe tags for the prefix list.
versionintegerThe version of the prefix list.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_managed_prefix_listsselectregionDryRun, Filter, MaxResults, NextToken, PrefixListIdDescribes your managed prefix lists and any Amazon Web Services-managed prefix lists.
create_managed_prefix_listinsertPrefixListName, MaxEntries, AddressFamily, regionDryRun, Entry, TagSpecification, ClientTokenCreates 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_listupdatePrefixListId, regionDryRun, CurrentVersion, PrefixListName, AddEntry, RemoveEntry, MaxEntries, IpamPrefixListResolverSyncEnabledModifies 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_listdeletePrefixListId, regionDryRunDeletes the specified managed prefix list. You must first remove all references to the prefix list in your resources.
restore_managed_prefix_list_versionexecPrefixListId, PreviousVersion, CurrentVersion, regionDryRunRestores 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.

NameDatatypeDescription
AddressFamilystringThe IP address type. Valid Values: IPv4 | IPv6
CurrentVersioninteger (int64)The current version number for the prefix list.
MaxEntriesintegerThe maximum number of entries for the prefix list.
PrefixListIdstringThe ID of the prefix list.
PrefixListNamestringA name for the prefix list. Constraints: Up to 255 characters in length. The name cannot start with com.amazonaws.
PreviousVersioninteger (int64)The version to restore.
regionstringAWS region (default: us-east-1)
AddEntryarrayOne or more entries to add to the prefix list.
ClientTokenstringUnique, 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.
CurrentVersioninteger (int64)The current version of the prefix list.
DryRunbooleanChecks 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.
EntryarrayOne or more entries for the prefix list.
FilterarrayOne 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.
IpamPrefixListResolverSyncEnabledbooleanIndicates 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.
MaxEntriesintegerThe 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.
MaxResultsintegerThe maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.
NextTokenstringThe token for the next page of results.
PrefixListIdarrayOne or more prefix list IDs.
PrefixListNamestringA name for the prefix list.
RemoveEntryarrayOne or more entries to remove from the prefix list.
TagSpecificationarrayThe tags to apply to the prefix list during creation.

SELECT examples

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

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
;

UPDATE examples

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

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

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 }}
;