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

aws_codedeploy_deployment_group on_premises_instance_tag_filter not added after apply #6593

Closed
jdextraze opened this issue May 10, 2016 · 5 comments · Fixed by #6617
Closed
Assignees

Comments

@jdextraze
Copy link

I have a simple deployment group defined as

resource "aws_codedeploy_deployment_group" "qa" {
  app_name = "${aws_codedeploy_app.my_app.name}"
  deployment_group_name = "qa"
  service_role_arn      = "${terraform_remote_state.codedeploy.output.aws_iam_role_codedeploy_service_role_arn}"
  deployment_config_name = "CodeDeployDefault.OneAtATime"
  on_premises_instance_tag_filter {
    type = "VALUE_ONLY"
    value = "staging-qa"
  }
}

When I run terraform plan, I can see that the deployment group will be created

+ aws_codedeploy_deployment_group.qa
    app_name:                                         "" => "My App"
    deployment_config_name:                           "" => "CodeDeployDefault.OneAtATime"
    deployment_group_name:                            "" => "qa"
    on_premises_instance_tag_filter.#:                "" => "1"
    on_premises_instance_tag_filter.1446378810.key:   "" => ""
    on_premises_instance_tag_filter.1446378810.type:  "" => "VALUE_ONLY"
    on_premises_instance_tag_filter.1446378810.value: "" => "staging-qa"
    service_role_arn:                                 "" => "arn:aws:iam::123456789012:role/CodeDeployServiceRole"

After running terraform apply with no error, when I go into AWS to verify the deployment group, the on premise instance tag is not added.

@stack72
Copy link
Contributor

stack72 commented May 10, 2016

Hi @jdextraze

Thanks for the report here - sorry this has caught you! I am trying to recreate this right now to see if we can get to the bottom of it

One thing I have found is that on a second apply, the tags actually do get added - so I am debugging this now

Paul

@stack72 stack72 self-assigned this May 10, 2016
@jdextraze
Copy link
Author

@stack72 second apply added the tag for me too, but crash terraform and corrupt state file.

panic: runtime error: invalid memory address or nil pointer dereference
2016/05/11 15:57:10 [DEBUG] terraform-provider-aws: [signal 0xb code=0x1 addr=0x8 pc=0x4ffa5a]
2016/05/11 15:57:10 [DEBUG] terraform-provider-aws:
2016/05/11 15:57:10 [DEBUG] terraform-provider-aws: goroutine 133 [running]:
2016/05/11 15:57:10 [DEBUG] terraform-provider-aws: panic(0x14027e0, 0xc82000a0f0)
2016/05/11 15:57:10 [DEBUG] terraform-provider-aws:     /opt/go/src/runtime/panic.go:481 +0x3e6
2016/05/11 15:57:10 [DEBUG] terraform-provider-aws: github.com/hashicorp/terraform/builtin/providers/aws.onPremisesTagFiltersToMap(0xc8200297e0, 0x1, 0x1, 0x0, 0x0, 0x0)
2016/05/11 15:57:10 [DEBUG] terraform-provider-aws:     /opt/gopath/src/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_codedeploy_deployment_group.go:403 +0x11a
2016/05/11 15:57:10 [DEBUG] terraform-provider-aws: github.com/hashicorp/terraform/builtin/providers/aws.resourceAwsCodeDeployDeploymentGroupRead(0xc820384fc0, 0x10970e0, 0xc820396000, 0x0, 0x0)
2016/05/11 15:57:10 [DEBUG] terraform-provider-aws:     /opt/gopath/src/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_codedeploy_deployment_group.go:252 +0x761
2016/05/11 15:57:10 [DEBUG] terraform-provider-aws: github.com/hashicorp/terraform/builtin/providers/aws.resourceAwsCodeDeployDeploymentGroupUpdate(0xc820384fc0, 0x10970e0, 0xc820396000, 0x0, 0x0)
2016/05/11 15:57:10 [DEBUG] terraform-provider-aws:     /opt/gopath/src/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_codedeploy_deployment_group.go:306 +0xa90
2016/05/11 15:57:10 [DEBUG] terraform-provider-aws: github.com/hashicorp/terraform/helper/schema.(*Resource).Apply(0xc8204248c0, 0xc8201dec00, 0xc8204624e0, 0x10970e0, 0xc820396000, 0xc820108101, 0x0, 0x0)
2016/05/11 15:57:10 [DEBUG] terraform-provider-aws:     /opt/gopath/src/github.com/hashicorp/terraform/helper/schema/resource.go:152 +0x3b9
2016/05/11 15:57:10 [DEBUG] terraform-provider-aws: github.com/hashicorp/terraform/helper/schema.(*Provider).Apply(0xc82048ba40, 0xc820310d80, 0xc8201dec00, 0xc8204624e0, 0x227f501, 0x0, 0x0)
2016/05/11 15:57:10 [DEBUG] terraform-provider-aws:     /opt/gopath/src/github.com/hashicorp/terraform/helper/schema/provider.go:162 +0x1ed
2016/05/11 15:57:10 [DEBUG] terraform-provider-aws: github.com/hashicorp/terraform/rpc.(*ResourceProviderServer).Apply(0xc8204ca420, 0xc820488920, 0xc820462580, 0x0, 0x0)
2016/05/11 15:57:10 [DEBUG] terraform-provider-aws:     /opt/gopath/src/github.com/hashicorp/terraform/rpc/resource_provider.go:323 +0x76
2016/05/11 15:57:10 [DEBUG] terraform-provider-aws: reflect.Value.call(0x133bf20, 0x16481d8, 0x13, 0x16fff20, 0x4, 0xc82035bed8, 0x3, 0x3, 0x0, 0x0, ...)
2016/05/11 15:57:10 [DEBUG] terraform-provider-aws:     /opt/go/src/reflect/value.go:435 +0x120d
2016/05/11 15:57:10 [DEBUG] terraform-provider-aws: reflect.Value.Call(0x133bf20, 0x16481d8, 0x13, 0xc82035bed8, 0x3, 0x3, 0x0, 0x0, 0x0)
2016/05/11 15:57:10 [DEBUG] terraform-provider-aws:     /opt/go/src/reflect/value.go:303 +0xb1
2016/05/11 15:57:10 [DEBUG] terraform-provider-aws: net/rpc.(*service).call(0xc82033cc40, 0xc82033cc00, 0xc8204c5620, 0xc82041c400, 0xc82048d180, 0x1097f80, 0xc820488920, 0x16, 0x1097fe0, 0xc820462580, ...)
2016/05/11 15:57:10 [DEBUG] terraform-provider-aws:     /opt/go/src/net/rpc/server.go:383 +0x1c2
2016/05/11 15:57:10 [DEBUG] terraform-provider-aws: created by net/rpc.(*Server).ServeCodec
2016/05/11 15:57:10 [DEBUG] terraform-provider-aws:     /opt/go/src/net/rpc/server.go:477 +0x49d

@stack72
Copy link
Contributor

stack72 commented May 11, 2016

hi @jdextraze

That is exactly what i am trying to debug right now :)

P.

@stack72
Copy link
Contributor

stack72 commented May 11, 2016

@jdextraze

just found the bug and opened a PR to fix it - thanks for reporting it

Paul

@ghost
Copy link

ghost commented Apr 25, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants