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

temporary_iam_instance_profile_policy_document doesn't use poller configs #398

Closed
imcdo opened this issue Jun 9, 2023 · 1 comment · Fixed by #399
Closed

temporary_iam_instance_profile_policy_document doesn't use poller configs #398

imcdo opened this issue Jun 9, 2023 · 1 comment · Fixed by #399
Labels

Comments

@imcdo
Copy link
Contributor

imcdo commented Jun 9, 2023

When filing a bug, please include the following headings if possible. Any
example text in this template can be deleted.

Overview of the Issue

I have configured a temporary_iam_instance_profile_policy_document for an amazon-ebs source. However it always fails to create the role with

Timed out waiting for temporary role

it seems like instead of passing forward the global polling configs such that this is configurable, we are doing:
https://github.com/hashicorp/packer-plugin-amazon/blob/8e1e361e8d32e909f6fc8597625f7a0d95c088d0/builder/common/step_iam_instance_profile.go#LL119C16-L119C35

which calls WaitUntilRoleExistsWithContext with its default values of 20 attempts with a 1 second backoff instead we should pass in the poller config and allow users to configure this

https://github.com/aws/aws-sdk-go/blob/a5bef1542952d979233bd92569aa09eeb7686c6a/service/iam/waiters.go#L133-L134

Reproduction Steps

set temporary_iam_instance_profile_policy_document
and have it take more than 30 seconds for aws to create the role.

Steps to reproduce this issue

Plugin and Packer version

From packer version
1.0.9

Simplified Packer Buildfile

temporary_iam_instance_profile_policy_document {
Statement {
Action = [
"ecr:GetAuthorizationToken",
"ecr:DescribeImages",
"ecr:ListImages",
"ecr:BatchGetImage",
"ecr:DescribeRegistry",
"ecr:DescribeRepositories",
"ecr:ListTagsForResource",
"ecr:GetDownloadUrlForLayer"
]
Effect = "Allow"
Resource = ["*"]
}
Version = "2012-10-17"
}

Operating system and Environment details

OS, Architecture, and any other information you can provide about the
environment.
ubuntu20

Log Fragments and crash.log files

Include appropriate log fragments. If the log is longer than a few dozen lines,
please include the URL to the gist of the log or
use the Github detailed format instead of posting it directly in the issue.

name.amazon-ebs.ubuntu: output will be in this color. 02:10
==> name.amazon-ebs.ubuntu: Prevalidating any provided VPC information 02:10
==> name.amazon-ebs.ubuntu: Prevalidating AMI Name: name-x86_64-392bf324d41345eeef878dd77aafa924 02:10
    name.amazon-ebs.ubuntu: Found Image ID: ami-<> 02:10
    name.amazon-ebs.ubuntu: Found VPC ID: vpc-<> 02:10
    name.amazon-ebs.ubuntu: Found Subnet ID: subnet-<> 02:10
==> name.ubuntu: Creating temporary keypair: packer_<> 02:10
==> name.amazon-ebs.ubuntu: Creating temporary security group for this instance: packer_<> 02:10
==> name.amazon-ebs.ubuntu: Authorizing access to port 22 from [0.0.0.0/0] in the temporary security groups... 02:11
==> name.amazon-ebs.ubuntu: Creating temporary instance profile for this instance: packer-<> 02:11
==> name.amazon-ebs.ubuntu: Creating temporary role for this instance: packer-<> 02:12
==> name.amazon-ebs.ubuntu: Deleting temporary role... 02:37
==> name.amazon-ebs.ubuntu: Deleting temporary instance profile... 02:37
  02:37
==> name.amazon-ebs.ubuntu: Deleting temporary keypair... 02:38
Build 'name.amazon-ebs.ubuntu' errored after 28 seconds 42 milliseconds: Timed out waiting for temporary role packer-<>: ResourceNotReady: exceeded wait attempts
@keenan-v1
Copy link
Contributor

When will this be released? The last release was two months ago. Even a beta or pre-release would allow me to use this fix as I am currently blocked by the wait timeout for temporary profiles. Unless there is a work-around?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants