Skip to main content

core_network_policies

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

Overview

Namecore_network_policies
TypeResource
Idaws.networkmanager.core_network_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
aliasstringWhether a core network policy is the current LIVE policy or the most recently submitted policy. (LIVE, LATEST)
change_set_statestringThe state of a core network policy. (PENDING_GENERATION, FAILED_GENERATION, READY_TO_EXECUTE, EXECUTING, EXECUTION_SUCCEEDED, OUT_OF_DATE)
core_network_idstringThe ID of a core network. (pattern: <code>^core-network-([0-9a-f]{8,17})$</code>)
created_atstring (date-time)The timestamp when a core network policy was created.
descriptionstringThe description of a core network policy. (pattern: <code>[\s\S]*</code>)
policy_documentstringDescribes a core network policy. (pattern: <code>[\s\S]*</code>)
policy_errorsarrayDescribes any errors in a core network policy.
policy_version_idintegerThe ID of the policy version.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_core_network_policyselectcore_network_id, regionpolicyVersionId, aliasReturns details about a core network policy. You can get details about your current live policy or any previous policy version.
put_core_network_policyreplacecore_network_id, region, PolicyDocumentCreates a new, immutable version of a core network policy. A subsequent change set is created showing the differences between the LIVE policy and the submitted policy.
restore_core_network_policy_versionexeccore_network_id, policy_version_id, regionRestores a previous policy version as a new, immutable version of a core network policy. A subsequent change set is created showing the differences between the LIVE policy and restored policy.

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
core_network_idstringThe ID of a core network.
policy_version_idintegerThe ID of the policy version to restore.
regionstringAWS region (default: us-east-1)
aliasstringThe alias of a core network policy
policyVersionIdintegerThe ID of a core network policy version.

SELECT examples

Returns details about a core network policy. You can get details about your current live policy or any previous policy version.

SELECT
alias,
change_set_state,
core_network_id,
created_at,
description,
policy_document,
policy_errors,
policy_version_id
FROM aws.networkmanager.core_network_policies
WHERE core_network_id = '{{ core_network_id }}' -- required
AND region = '{{ region }}' -- required
AND policyVersionId = '{{ policyVersionId }}'
AND alias = '{{ alias }}'
;

REPLACE examples

Creates a new, immutable version of a core network policy. A subsequent change set is created showing the differences between the LIVE policy and the submitted policy.

REPLACE aws.networkmanager.core_network_policies
SET
PolicyDocument = '{{ PolicyDocument }}',
Description = '{{ Description }}',
LatestVersionId = {{ LatestVersionId }},
ClientToken = '{{ ClientToken }}'
WHERE
core_network_id = '{{ core_network_id }}' --required
AND region = '{{ region }}' --required
AND PolicyDocument = '{{ PolicyDocument }}' --required
RETURNING
core_network_policy;

Lifecycle Methods

Restores a previous policy version as a new, immutable version of a core network policy. A subsequent change set is created showing the differences between the LIVE policy and restored policy.

EXEC aws.networkmanager.core_network_policies.restore_core_network_policy_version
@core_network_id='{{ core_network_id }}' --required,
@policy_version_id='{{ policy_version_id }}' --required,
@region='{{ region }}' --required
;