ipams
Creates, updates, deletes or gets an ipam resource or lists ipams in a region
Overview
| Name | ipams |
| Type | Resource |
| Description | Resource Schema of AWS::EC2::IPAM Type |
| Id | awscc.ec2.ipams |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
ipam_id | string | Id of the IPAM. |
arn | string | The Amazon Resource Name (ARN) of the IPAM. |
default_resource_discovery_id | string | The Id of the default resource discovery, created with this IPAM. |
default_resource_discovery_association_id | string | The Id of the default association to the default resource discovery, created with this IPAM. |
resource_discovery_association_count | integer | The count of resource discoveries associated with this IPAM. |
description | string | |
public_default_scope_id | string | The Id of the default scope for publicly routable IP space, created with this IPAM. |
private_default_scope_id | string | The Id of the default scope for publicly routable IP space, created with this IPAM. |
scope_count | integer | The number of scopes that currently exist in this IPAM. |
operating_regions | array | The regions IPAM is enabled for. Allows pools to be created in these regions, as well as enabling monitoring |
tier | string | The tier of the IPAM. |
enable_private_gua | boolean | Enable provisioning of GUA space in private pools. |
metered_account | string | A metered account is an account that is charged for active IP addresses managed in IPAM |
default_resource_discovery_organizational_unit_exclusions | array | A set of organizational unit (OU) exclusions for the default resource discovery, created with this IPAM. |
tags | array | An array of key-value pairs to apply to this resource. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
ipam_id | string | Id of the IPAM. |
region | string | AWS region. |
For more information, see AWS::EC2::IPAM.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | ipams | INSERT | , region |
delete_resource | ipams | DELETE | Identifier, region |
update_resource | ipams | UPDATE | Identifier, PatchDocument, region |
list_resources | ipams_list_only | SELECT | region |
get_resource | ipams | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual ipam.
SELECT
region,
ipam_id,
arn,
default_resource_discovery_id,
default_resource_discovery_association_id,
resource_discovery_association_count,
description,
public_default_scope_id,
private_default_scope_id,
scope_count,
operating_regions,
tier,
enable_private_gua,
metered_account,
default_resource_discovery_organizational_unit_exclusions,
tags
FROM awscc.ec2.ipams
WHERE
region = '{{ region }}' AND
Identifier = '{{ ipam_id }}';
Lists all ipams in a region.
SELECT
region,
ipam_id
FROM awscc.ec2.ipams_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new ipam resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.ec2.ipams (
,
region
)
SELECT
'{{ }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.ec2.ipams (
Description,
OperatingRegions,
Tier,
EnablePrivateGua,
MeteredAccount,
DefaultResourceDiscoveryOrganizationalUnitExclusions,
Tags,
region
)
SELECT
'{{ description }}',
'{{ operating_regions }}',
'{{ tier }}',
'{{ enable_private_gua }}',
'{{ metered_account }}',
'{{ default_resource_discovery_organizational_unit_exclusions }}',
'{{ tags }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: ipam
props:
- name: description
value: '{{ description }}'
- name: operating_regions
value:
- region_name: '{{ region_name }}'
- name: tier
value: '{{ tier }}'
- name: enable_private_gua
value: '{{ enable_private_gua }}'
- name: metered_account
value: '{{ metered_account }}'
- name: default_resource_discovery_organizational_unit_exclusions
value:
- organizations_entity_path: '{{ organizations_entity_path }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a ipam resource, using stack-deploy.
/*+ update */
UPDATE awscc.ec2.ipams
SET PatchDocument = string('{{ {
"Description": description,
"OperatingRegions": operating_regions,
"Tier": tier,
"EnablePrivateGua": enable_private_gua,
"MeteredAccount": metered_account,
"DefaultResourceDiscoveryOrganizationalUnitExclusions": default_resource_discovery_organizational_unit_exclusions,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ ipam_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.ec2.ipams
WHERE
Identifier = '{{ ipam_id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the ipams resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
ec2:CreateIpam,
iam:CreateServiceLinkedRole,
ec2:CreateTags,
ec2:DescribeIpams,
ec2:DescribeIpamResourceDiscoveries,
ec2:ModifyIpamResourceDiscovery
ec2:DescribeIpams,
ec2:DescribeIpamResourceDiscoveries
ec2:ModifyIpam,
ec2:CreateTags,
ec2:DeleteTags,
ec2:DescribeIpams,
ec2:DescribeIpamResourceDiscoveries,
ec2:ModifyIpamResourceDiscovery
ec2:DeleteIpam,
ec2:DeleteTags,
ec2:DescribeIpams
ec2:DescribeIpams