core_network_policies
Creates, updates, deletes, gets or lists a core_network_policies resource.
Overview
| Name | core_network_policies |
| Type | Resource |
| Id | aws.networkmanager.core_network_policies |
Fields
The following fields are returned by SELECT queries:
- get_core_network_policy
| Name | Datatype | Description |
|---|---|---|
alias | string | Whether a core network policy is the current LIVE policy or the most recently submitted policy. (LIVE, LATEST) |
change_set_state | string | The state of a core network policy. (PENDING_GENERATION, FAILED_GENERATION, READY_TO_EXECUTE, EXECUTING, EXECUTION_SUCCEEDED, OUT_OF_DATE) |
core_network_id | string | The ID of a core network. (pattern: <code>^core-network-([0-9a-f]{8,17})$</code>) |
created_at | string (date-time) | The timestamp when a core network policy was created. |
description | string | The description of a core network policy. (pattern: <code>[\s\S]*</code>) |
policy_document | string | Describes a core network policy. (pattern: <code>[\s\S]*</code>) |
policy_errors | array | Describes any errors in a core network policy. |
policy_version_id | integer | The ID of the policy version. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_core_network_policy | select | core_network_id, region | policyVersionId, alias | Returns details about a core network policy. You can get details about your current live policy or any previous policy version. |
put_core_network_policy | replace | core_network_id, region, PolicyDocument | 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. | |
restore_core_network_policy_version | exec | core_network_id, policy_version_id, region | 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. |
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 |
|---|---|---|
core_network_id | string | The ID of a core network. |
policy_version_id | integer | The ID of the policy version to restore. |
region | string | AWS region (default: us-east-1) |
alias | string | The alias of a core network policy |
policyVersionId | integer | The ID of a core network policy version. |
SELECT examples
- get_core_network_policy
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
- put_core_network_policy
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
- restore_core_network_policy_version
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
;