aws-cloudformation-user-guide icon indicating copy to clipboard operation
aws-cloudformation-user-guide copied to clipboard

Note/maintenance window targets

Open GlennChia opened this issue 2 years ago • 2 comments

Issue #, if available:

Description of changes:

  • [OUTDATED THIS DOES NOT HAVE THE INTENDED EFFECT REFER TO LATEST COMMENT in PR FOR WORKING EXAMPLE] Add note on how to target all Values for a particular Key. This is achieved by specifying Values with a *. In the console, Values is Optional but in CloudFormation, Values is a Required attribute and we cannot pass in an empty string. To replicate the console behaviour, we must specify a *. Mentioning this in the documentation could be useful for those who would like to target all Values for a particular Key

image

  • Style fixes by removing trailing whitespaces

Console reference:

  • The input box shows Tag value (optional) image
  • Upon clicking Add, we see Name: (All values) image

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

GlennChia avatar Mar 11 '22 15:03 GlennChia

I realised that adding the * does not have the intended effect of targeting all Values. Will need to take a second look at it

image

GlennChia avatar Mar 17 '22 16:03 GlennChia

Made some changes based on the example at AWS docs: Register targets using a group of tag keys (without tag values) and the solution works now. Example snippet:

MaintenanceWindowTargetEC2:
  Type: AWS::SSM::MaintenanceWindowTarget
  Properties:
    Description: target ec2 instances
    Name: target-all-values
    ResourceType: INSTANCE
    Targets:
    - Key: tag-key
      Values:
      - Name
    WindowId: !Ref MaintenanceWindow

GlennChia avatar Mar 17 '22 17:03 GlennChia

Closing this issue or pull request in advance of archiving this repo. For more information about the decision to archive this repo (and others in the "awsdocs" org), see the announcement on the AWS News Blog.

joshbean avatar Dec 07 '23 23:12 joshbean