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

resource/aws_codepipeline: TestAccAWSCodePipeline_deployWithServiceRole Test Failures #14810

Closed
bflad opened this issue Aug 24, 2020 · 2 comments · Fixed by #14830
Closed

resource/aws_codepipeline: TestAccAWSCodePipeline_deployWithServiceRole Test Failures #14810

bflad opened this issue Aug 24, 2020 · 2 comments · Fixed by #14830
Labels
good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/codepipeline Issues and PRs that pertain to the codepipeline service. service/iam Issues and PRs that pertain to the iam service. technical-debt Addresses areas of the codebase that need refactoring or redesign. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Milestone

Comments

@bflad
Copy link
Contributor

bflad commented Aug 24, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

After some recent Terraform 0.12 syntax upgrades in test configurations, the following test is now consistently failing:

=== CONT  TestAccAWSCodePipeline_deployWithServiceRole
TestAccAWSCodePipeline_deployWithServiceRole: resource_aws_codepipeline_test.go:199: Step 1/2 error: terraform failed: exit status 1
stderr:
Error: Error creating CodePipeline: InvalidStructureException: arn:aws:iam::*******:role/codepipeline-role-v18zpiskec is not authorized to perform AssumeRole on role arn:aws:iam::*******:role/codepipeline-action-role-v18zpiskec
Error: "policy" contains an invalid JSON: invalid character 'a' looking for beginning of value
on config762278342/terraform_plugin_test.tf line 30, in resource "aws_iam_role_policy" "codepipeline_policy":
30:   policy = <<EOF
31: {
32:   "Version": "2012-10-17",
33:   "Statement": [
34:     {
35:       "Effect":"Allow",
36:       "Action": [
37:         "s3:GetObject",
38:         "s3:GetObjectVersion",
39:         "s3:GetBucketVersioning"
40:       ],
41:       "Resource": [
42:         "${aws_s3_bucket.test.arn}",
43:         "${aws_s3_bucket.test.arn}/*"
44:       ]
45:     },
46:     {
47:       "Effect": "Allow",
48:       "Action": [
49:         "codebuild:BatchGetBuilds",
50:         "codebuild:StartBuild"
51:       ],
52:       "Resource": "*"
53:     },
54:     {
55:       "Effect": "Allow",
56:       "Action": [
57:         "sts:AssumeRole"
58:       ],
59:       "Resource": aws_iam_role.codepipeline_action_role.arn
60:     }
61:   ]
62: }
63: EOF
--- FAIL: TestAccAWSCodePipeline_deployWithServiceRole (146.86s)

Implementing string interpolation around the aws_iam_role.codepipeline_action_role.arn ("${aws_iam_role.codepipeline_action_role.arn}") should fix the testing and allow it pass as it did previously.

Affected Resources

  • aws_codepipeline

Affected Tests

  • TestAccAWSCodePipeline_deployWithServiceRole

References

@bflad bflad added good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/codepipeline Issues and PRs that pertain to the codepipeline service. technical-debt Addresses areas of the codebase that need refactoring or redesign. labels Aug 24, 2020
@bflad bflad added this to the Roadmap milestone Aug 24, 2020
@ghost ghost added the service/iam Issues and PRs that pertain to the iam service. label Aug 24, 2020
@bflad bflad modified the milestones: Roadmap, v3.4.0 Aug 25, 2020
@ghost
Copy link

ghost commented Aug 27, 2020

This has been released in version 3.4.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Sep 24, 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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Sep 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/codepipeline Issues and PRs that pertain to the codepipeline service. service/iam Issues and PRs that pertain to the iam service. technical-debt Addresses areas of the codebase that need refactoring or redesign. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant