Skip to content

Commit 3f98a1c

Browse files
authored
Documentation updates (#18)
* Add documentation for filter plugins. * Use non-deprecated documentation fragments for modules. * Bump the collection version to 4.0.1.
1 parent dba73bb commit 3f98a1c

15 files changed

+131
-21
lines changed

galaxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace: mattclay
99
name: aws
1010

1111
# The version of the collection. Must be compatible with semantic versioning
12-
version: 4.0.0
12+
version: 4.0.1
1313

1414
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
1515
readme: README.md

plugins/filter/dictfilter.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
DOCUMENTATION:
2+
name: dictfilter
3+
short_description: filter a dictionary to return only the specified keys
4+
description:
5+
- The input dictionary will be returned with only the specified keys present.
6+
positional: _input, keys
7+
options:
8+
_input:
9+
description: A dictionary to filter.
10+
type: dict
11+
required: true
12+
keys:
13+
description: The list of dictionary keys to preserve.
14+
type: list
15+
elements: str
16+
required: true
17+
18+
EXAMPLES: |
19+
- '{} | mattclay.aws.dictfilter([]) == {}'
20+
- '{} | mattclay.aws.dictfilter(["a"]) == {}'
21+
- '{"a": 1} | mattclay.aws.dictfilter(["a"]) == {"a": 1}'
22+
- '{"a": 1, "b": 2} | mattclay.aws.dictfilter(["a"]) == {"a": 1}'
23+
- '{"a": 1, "b": 2} | mattclay.aws.dictfilter(["a", "b"]) == {"a": 1, "b": 2}'
24+
- '{"a": 1, "b": 2} | mattclay.aws.dictfilter(["c"]) == {}'
25+
26+
RETURN:
27+
_value:
28+
description: The dictionary with only the specified keys present.
29+
type: dict
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
DOCUMENTATION:
2+
name: ec2_az_vpc_route_tables_subnets
3+
short_description: generate a list of subnets from availability zones
4+
description:
5+
- Use the input zones dictionary and provided subnet format string to build a list of subnets.
6+
positional: _input, subnet
7+
options:
8+
_input:
9+
description: A dictionary of availability zones. The key is the zone name. The value is unused.
10+
type: dict
11+
required: true
12+
subnet:
13+
description: The subnet format string. The placeholder will be replaced with a number representing the availability zone, with ``a`` being ``0``.
14+
type: str
15+
required: true
16+
17+
EXAMPLES: |
18+
- '{"us-east-1a": {}, "us-east-1b": {}} | mattclay.aws.ec2_az_vpc_route_tables_subnets("192.168.%s.0/24") == ["192.168.0.0/24", "192.168.1.0/24"]'
19+
- '{"us-east-1f": {}} | mattclay.aws.ec2_az_vpc_route_tables_subnets("192.168.%s.0/24") == ["192.168.5.0/24"]'
20+
21+
RETURN:
22+
_value:
23+
description: A list of subnets.
24+
type: list
25+
elements: str

plugins/filter/ec2_az_vpc_subnets.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
DOCUMENTATION:
2+
name: ec2_az_vpc_subnets
3+
short_description: generate a list of availability zones and subnets
4+
description:
5+
- Use the input zones dictionary, provided subnet format string and tag name to build a list of availiability zones with subnets.
6+
positional: _input, subnet, name
7+
options:
8+
_input:
9+
description: A dictionary of availability zones. The key is the zone name. The value is unused.
10+
type: dict
11+
required: true
12+
subnet:
13+
description: The subnet format string. The placeholder will be replaced with a number representing the availability zone, with ``a`` being ``0``.
14+
type: str
15+
required: true
16+
name:
17+
description: The name (tag) to apply to the subnet.
18+
type: str
19+
required: true
20+
21+
EXAMPLES: |
22+
- '{"us-east-1a": {}} | mattclay.aws.ec2_az_vpc_subnets("192.168.%s.0/24", "Bob") == [{ "az": "us-east-1a", "cidr": "192.168.0.0/24", "resource_tags": {"Name": "Bob"}}]'
23+
- '{"us-east-1f": {}} | mattclay.aws.ec2_az_vpc_subnets("192.168.%s.0/24", "Bob") == [{ "az": "us-east-1f", "cidr": "192.168.5.0/24", "resource_tags": {"Name": "Bob"}}]'
24+
25+
RETURN:
26+
_value:
27+
description: A list of dictionaries representing the generated availability zones and subnets.
28+
type: list
29+
elements: dict

plugins/filter/map_format.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
DOCUMENTATION:
2+
name: map_format
3+
short_description: format a string using
4+
description:
5+
- Use a dictionary of input values to render the given format string.
6+
positional: _input, fmt
7+
options:
8+
_input:
9+
description: A dictionary of values available to be used in the format string.
10+
type: dict
11+
required: true
12+
fmt:
13+
description: A format string to render.
14+
type: str
15+
required: true
16+
17+
EXAMPLES: |
18+
- '{} | mattclay.aws.map_format("Hello") == "Hello"'
19+
- '{"age": 21} | mattclay.aws.map_format("Hello {name} {age}", name="Bob") == "Hello Bob 21"'
20+
- '{"name": "World"} | mattclay.aws.map_format("Hello {name}") == "Hello World"'
21+
- '{"name": "World"} | mattclay.aws.map_format("Hello {name}", name="Bob") == "Hello Bob"'
22+
- '{"name": "World"} | mattclay.aws.map_format("Hello {name} {0}", 3) == "Hello World 3"'
23+
24+
RETURN:
25+
_value:
26+
description: Rendered string.
27+
type: str

plugins/modules/apigateway.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@
6969
type: dict
7070
default: {}
7171
extends_documentation_fragment:
72-
- amazon.aws.aws
73-
- amazon.aws.ec2
72+
- amazon.aws.common.modules
73+
- amazon.aws.region.modules
7474
'''
7575

7676
EXAMPLES = '''

plugins/modules/aws_account_facts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
- boto3
1515
- botocore
1616
extends_documentation_fragment:
17-
- amazon.aws.aws
18-
- amazon.aws.ec2
17+
- amazon.aws.common.modules
18+
- amazon.aws.region.modules
1919
'''
2020

2121
EXAMPLES = '''

plugins/modules/aws_availability_zone_facts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
- boto3
1515
- botocore
1616
extends_documentation_fragment:
17-
- amazon.aws.aws
18-
- amazon.aws.ec2
17+
- amazon.aws.common.modules
18+
- amazon.aws.region.modules
1919
'''
2020

2121
EXAMPLES = '''

plugins/modules/cloudwatch_event.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
default: enabled
4747
type: str
4848
extends_documentation_fragment:
49-
- amazon.aws.aws
50-
- amazon.aws.ec2
49+
- amazon.aws.common.modules
50+
- amazon.aws.region.modules
5151
'''
5252

5353
EXAMPLES = '''

plugins/modules/lambda.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@
107107
type: list
108108
elements: str
109109
extends_documentation_fragment:
110-
- amazon.aws.aws
111-
- amazon.aws.ec2
110+
- amazon.aws.common.modules
111+
- amazon.aws.region.modules
112112
'''
113113

114114
EXAMPLES = '''

plugins/modules/lambda_alias.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
type: str
4545
default: ''
4646
extends_documentation_fragment:
47-
- amazon.aws.aws
48-
- amazon.aws.ec2
47+
- amazon.aws.common.modules
48+
- amazon.aws.region.modules
4949
'''
5050

5151
EXAMPLES = '''

plugins/modules/lambda_layer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
default: present
4848
type: str
4949
extends_documentation_fragment:
50-
- amazon.aws.aws
51-
- amazon.aws.ec2
50+
- amazon.aws.common.modules
51+
- amazon.aws.region.modules
5252
'''
5353

5454
EXAMPLES = '''

plugins/modules/lambda_policy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
required: true
4646
type: str
4747
extends_documentation_fragment:
48-
- amazon.aws.aws
49-
- amazon.aws.ec2
48+
- amazon.aws.common.modules
49+
- amazon.aws.region.modules
5050
'''
5151

5252
EXAMPLES = '''

plugins/modules/sqs_event.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
default: present
3838
type: str
3939
extends_documentation_fragment:
40-
- amazon.aws.aws
41-
- amazon.aws.ec2
40+
- amazon.aws.common.modules
41+
- amazon.aws.region.modules
4242
'''
4343

4444
EXAMPLES = '''

plugins/modules/sqs_fifo_queue.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
default: present
3737
type: str
3838
extends_documentation_fragment:
39-
- amazon.aws.aws
40-
- amazon.aws.ec2
39+
- amazon.aws.common.modules
40+
- amazon.aws.region.modules
4141
'''
4242

4343
EXAMPLES = '''

0 commit comments

Comments
 (0)