Skip to content
New issue

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

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

Already on GitHub? # to your account

aws_launch_configuration Resource is Marked as Supporting Tags #107

Closed
anthonycolon25 opened this issue Jun 25, 2019 · 7 comments
Closed
Assignees
Labels

Comments

@anthonycolon25
Copy link

I have an autoscaling group with and aws_launch_configuration. When I run the test it fails stating the following:

Scenario Outline: Ensure that specific tags are defined
        Given I have resource that supports tags defined
        When it contains tags
        Then it must contain <tags>

    Examples:
        | tags |
        | Name |
          Failure: aws_launch_configuration.example (resource that supports tags) does not have Name property.

When I add tags to the aws_launch_configuration resource in terraform and try to . build the plan it gives an error:

$ terraform plan -out=plan.out

Error: Unsupported argument

  on main.tf line 50, in resource "aws_launch_configuration" "example":
  50:   tags = [

An argument named "tags" is not expected here.

It doesn't look like aws_launch_configuration resources supports tags.

@eerkunt
Copy link
Member

eerkunt commented Jun 26, 2019

Is it possible to share plan.out.json for debugging, if it is not confidential ?

@eerkunt eerkunt self-assigned this Jun 26, 2019
@eerkunt eerkunt added the require more data Further data is required to initiate debugging/troubleshooting label Jun 26, 2019
@anthonycolon25
Copy link
Author

anthonycolon25 commented Jun 26, 2019

Here you go. One question that comes to mind is are aws_launch_configuration resources still valid in 0.12+? Should it be aws_launch_template?
plan.out.json.txt

@eerkunt
Copy link
Member

eerkunt commented Jun 26, 2019

Thanks! It looks like the problem is there due to resource mounting.

Will create a fix asap.

@eerkunt eerkunt added bug fixing A fix is addressed, no further data is required and removed require more data Further data is required to initiate debugging/troubleshooting labels Jun 26, 2019
@anthonycolon25
Copy link
Author

What is resource mounting?

@eerkunt
Copy link
Member

eerkunt commented Jun 26, 2019

This is a feature of terraform-compliance to comply with deeper tests created with terraform.

E.g. ;

resource "aws_security_group" "my_security_group" {
  name        = "some-sg"
  ...
}

resource "aws_security_group_rule" "my_security_rule_1" {
  type                     = "ingress"
  from_port                = 443
  to_port                  = 443
  protocol                 = "tcp"
  ...
  ...
  security_group_id        = "${aws_security_group.security_group.id}"
}

Where aws_security_group_rule.my_security_rule_1 is actually mounted on aws_security_group.my_security_group - which means, when terraform-compliance runs a test against aws_security_group.my_security_group, it should also check all the mounted resources against that resource.

Specifically, the bug in your scenario was, aws_autoscaling_group.example (which supports tags) was mounted over aws_launch_configuration.example and when we search for the tags within the values, it was returning True.

Now it is fixed with 1.0.8, please have a try :)

@eerkunt eerkunt added waiting for confirmation Workaround/Fix applied, waiting for confirmation and removed fixing A fix is addressed, no further data is required labels Jun 26, 2019
@anthonycolon25
Copy link
Author

Tested with 1.0.8. it looks good. It is no longer failing for missing aws_launch_configuration tags.

Thanks.

@eerkunt eerkunt removed the waiting for confirmation Workaround/Fix applied, waiting for confirmation label Jun 27, 2019
@eerkunt
Copy link
Member

eerkunt commented Jun 27, 2019

Thanks for re-testing. Closing the issue.

@eerkunt eerkunt closed this as completed Jun 27, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants