Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ec2_launch_template - Add Template Tags support (only supports Resource Tags) #176

Closed
ElijahLynn opened this issue Aug 4, 2020 · 2 comments · Fixed by #2164
Closed

ec2_launch_template - Add Template Tags support (only supports Resource Tags) #176

ElijahLynn opened this issue Aug 4, 2020 · 2 comments · Fixed by #2164
Labels
affects_2.10 feature This issue/PR relates to a feature request module module plugins plugin (any type) waiting_on_contributor Needs help. Feel free to engage to get things unblocked

Comments

@ElijahLynn
Copy link

Moved from ansible/ansible#71101

SUMMARY

The https://docs.ansible.com/ansible/latest/modules/ec2_launch_template_module.html only supports "Tags" which are actually Resource Tags. The module should also support Template Tags. The key name will probably have to change and docs updated.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

ec2_launch_template

ADDITIONAL INFORMATION
@ElijahLynn
Copy link
Author

ElijahLynn commented Aug 4, 2020

It looks like Boto3 does support Template Tags as a top level "TagsSpecifications" property of create_launch_template(). The current implementation uses the TagsSpecifications of the LaunchTemplateData here.

def params_to_launch_data(module, template_params):
if template_params.get('tags'):
template_params['tag_specifications'] = [
{
'resource_type': r_type,
'tags': [
{'Key': k, 'Value': v} for k, v
in template_params['tags'].items()
]
}
for r_type in ('instance', 'volume')

try:
resp = ec2.create_launch_template(
LaunchTemplateName=module.params['template_name'],
LaunchTemplateData=lt_data,
ClientToken=uuid4().hex,
aws_retry=True,
)

@ansibullbot
Copy link

@ansibullbot ansibullbot added affects_2.10 feature This issue/PR relates to a feature request module module needs_triage labels Aug 19, 2020
@ansibullbot ansibullbot added the plugins plugin (any type) label Aug 27, 2020
@gravesm gravesm added waiting_on_contributor Needs help. Feel free to engage to get things unblocked and removed needs_triage labels Feb 12, 2021
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this issue May 25, 2022
* Clean up test requirements

We have unit test requirements from ansible/ansible that aren't needed for aws
@tremble tremble changed the title Add Template Tags support to ec2_launch_template (only supports Resource Tags) ec2_launch_template - Add Template Tags support (only supports Resource Tags) Feb 6, 2023
softwarefactory-project-zuul bot pushed a commit that referenced this issue Oct 18, 2024
SUMMARY

Depends-On: ansible-collections/amazon.aws#2319

Add some type hint for the module
Use shared code from amazon.aws.plugins.module_utils.ec2
Add the possibility to delete specific version of a launch template
Add support for tagging for launch template resource (Closes #176)
Add the possibility to tag specific resources, not always instance and volume (Closes [#48](#48, Closes #2083)
Support EBS Throughput (Closes #1944)
Fix issue occurring when launch template contains more than 200 versions (Closes #2131)


ISSUE TYPE


Feature Pull Request

COMPONENT NAME

ec2_launch_template

Reviewed-by: Alina Buzachis
Reviewed-by: Bikouo Aubin
Reviewed-by: GomathiselviS <[email protected]>
alinabuzachis pushed a commit to abikouo/community.aws that referenced this issue Oct 24, 2024
…#2164)

SUMMARY

Depends-On: ansible-collections/amazon.aws#2319

Add some type hint for the module
Use shared code from amazon.aws.plugins.module_utils.ec2
Add the possibility to delete specific version of a launch template
Add support for tagging for launch template resource (Closes ansible-collections#176)
Add the possibility to tag specific resources, not always instance and volume (Closes [ansible-collections#48](ansible-collections#48, Closes ansible-collections#2083)
Support EBS Throughput (Closes ansible-collections#1944)
Fix issue occurring when launch template contains more than 200 versions (Closes ansible-collections#2131)


ISSUE TYPE


Feature Pull Request

COMPONENT NAME

ec2_launch_template

Reviewed-by: Alina Buzachis
Reviewed-by: Bikouo Aubin
Reviewed-by: GomathiselviS <[email protected]>
alinabuzachis pushed a commit to GomathiselviS/community.aws that referenced this issue Oct 25, 2024
…#2164)

SUMMARY

Depends-On: ansible-collections/amazon.aws#2319

Add some type hint for the module
Use shared code from amazon.aws.plugins.module_utils.ec2
Add the possibility to delete specific version of a launch template
Add support for tagging for launch template resource (Closes ansible-collections#176)
Add the possibility to tag specific resources, not always instance and volume (Closes [ansible-collections#48](ansible-collections#48, Closes ansible-collections#2083)
Support EBS Throughput (Closes ansible-collections#1944)
Fix issue occurring when launch template contains more than 200 versions (Closes ansible-collections#2131)


ISSUE TYPE


Feature Pull Request

COMPONENT NAME

ec2_launch_template

Reviewed-by: Alina Buzachis
Reviewed-by: Bikouo Aubin
Reviewed-by: GomathiselviS <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects_2.10 feature This issue/PR relates to a feature request module module plugins plugin (any type) waiting_on_contributor Needs help. Feel free to engage to get things unblocked
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants