ip_sets
Creates, updates, deletes or gets an ip_set resource or lists ip_sets in a region
Overview
| Name | ip_sets |
| Type | Resource |
| Description | Contains a list of IP addresses. This can be either IPV4 or IPV6. The list will be mutually |
| Id | awscc.wafv2.ip_sets |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
arn | string | |
description | string | Description of the entity. |
name | string | Name of the WebACL. |
id | string | Id of the WebACL |
scope | string | Use CLOUDFRONT for CloudFront WebACL, use REGIONAL for Application Load Balancer and API Gateway. |
ip_address_version | string | Type of addresses in the IPSet, use IPV4 for IPV4 IP addresses, IPV6 for IPV6 address. |
addresses | array | List of IPAddresses. |
tags | array | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the WebACL. |
id | string | Id of the WebACL |
scope | string | Use CLOUDFRONT for CloudFront WebACL, use REGIONAL for Application Load Balancer and API Gateway. |
region | string | AWS region. |
For more information, see AWS::WAFv2::IPSet.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | ip_sets | INSERT | Addresses, IPAddressVersion, Scope, region |
delete_resource | ip_sets | DELETE | Identifier, region |
update_resource | ip_sets | UPDATE | Identifier, PatchDocument, region |
list_resources | ip_sets_list_only | SELECT | region |
get_resource | ip_sets | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual ip_set.
SELECT
region,
arn,
description,
name,
id,
scope,
ip_address_version,
addresses,
tags
FROM awscc.wafv2.ip_sets
WHERE
region = '{{ region }}' AND
Identifier = '{{ name }}|{{ id }}|{{ scope }}';
Lists all ip_sets in a region.
SELECT
region,
name,
id,
scope
FROM awscc.wafv2.ip_sets_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new ip_set resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.wafv2.ip_sets (
Scope,
IPAddressVersion,
Addresses,
region
)
SELECT
'{{ scope }}',
'{{ ip_address_version }}',
'{{ addresses }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.wafv2.ip_sets (
Description,
Name,
Scope,
IPAddressVersion,
Addresses,
Tags,
region
)
SELECT
'{{ description }}',
'{{ name }}',
'{{ scope }}',
'{{ ip_address_version }}',
'{{ addresses }}',
'{{ 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: ip_set
props:
- name: description
value: '{{ description }}'
- name: name
value: '{{ name }}'
- name: scope
value: '{{ scope }}'
- name: ip_address_version
value: '{{ ip_address_version }}'
- name: addresses
value:
- '{{ addresses[0] }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a ip_set resource, using stack-deploy.
/*+ update */
UPDATE awscc.wafv2.ip_sets
SET PatchDocument = string('{{ {
"Description": description,
"IPAddressVersion": ip_address_version,
"Addresses": addresses,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ name }}|{{ id }}|{{ scope }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.wafv2.ip_sets
WHERE
Identifier = '{{ name }}|{{ id }}|{{ scope }}' 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 ip_sets resource, the following permissions are required:
- Create
- Delete
- Read
- Update
- List
wafv2:CreateIPSet,
wafv2:GetIPSet,
wafv2:ListTagsForResource,
wafv2:TagResource,
wafv2:UntagResource
wafv2:DeleteIPSet,
wafv2:GetIPSet
wafv2:GetIPSet,
wafv2:ListTagsForResource
wafv2:UpdateIPSet,
wafv2:GetIPSet,
wafv2:ListTagsForResource,
wafv2:TagResource,
wafv2:UntagResource
wafv2:listIPSets