-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
IAM Policy Attachment: "timeout while waiting for state to become '[success]'" #5447
Comments
+1 |
1 similar comment
+1 |
Hi @jangrewe, Can you post a sample configuration to see if i can reproduce this? Paul |
Hi @stack72, |
ok, when you are back in the office, if you can, please post a snippet of your code. I have tried a few attachments (rather than inline) and they seem to work I'd like to try and help diagnose this Paul |
Similar issue here. Works pre-v0.6.12, but not on v.0.6.12. resource "aws_iam_role_policy" "aws_iam_role" {
name = "aws_iam_role"
role = "${aws_iam_role.ecs_instance_role.id}"
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"elasticloadbalancing:Describe*",
"elasticloadbalancing:DeregisterInstancesFromLoadBalancer",
"elasticloadbalancing:RegisterInstancesWithLoadBalancer",
"ec2:Describe*",
"ec2:AuthorizeSecurityGroupIngress"
],
"Effect": "Allow",
"Resource": "*"
}
]
}
EOF
lifecycle {
create_before_destroy = true
}
}
resource "aws_iam_role" "ecs_instance_role" {
name = "ecs_instance_role"
assume_role_policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "sts:AssumeRole",
"Principal": {"AWS": "*"},
"Effect": "Allow",
"Sid": ""
},
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": "ec2.amazonaws.com"
},
"Action": "sts:AssumeRole"
},
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": "ecs.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
EOF
lifecycle {
create_before_destroy = true
}
}
resource "aws_iam_policy_attachment" "ecs_service_role" {
name = "ecs_service_role"
roles = ["${aws_iam_role.ecs_instance_role.name}"]
policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceRole"
lifecycle {
create_before_destroy = true
}
}
resource "aws_iam_policy_attachment" "ecs_service_ec2_role" {
name = "ecs_service_ec2_role"
roles = ["${aws_iam_role.ecs_instance_role.name}"]
policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role"
lifecycle {
create_before_destroy = true
}
}
resource "aws_iam_instance_profile" "aws_iam_role" {
name = "aws_iam_role"
roles = ["${aws_iam_role.ecs_instance_role.name}"]
lifecycle {
create_before_destroy = true
}
} I got this:
|
Is there any workaround for the |
Hi @stack72, thanks for the update! I've tested the fix from #5460 (downloaded and overwrote wait.go), but sadly the issue is still the same. Here's how i'm doing the policy attachment:
|
I can confirm that it's working fine with v0.6.11, though! |
I do have a similar issue. I am on version 0.6.12. terraform plan looks good, but apply return error. resource "aws_lambda_function" "bobbyfox_test" {
|
I can also confirm this on v0.6.12 The timeout happens but the policy attachment actually works as verified on aws console.
|
I am seeing the same error. Version 0.6.12 3 error(s) occurred:
resource "aws_iam_policy_attachment" "elasticsearch_policy_attach1" { resource "aws_iam_policy_attachment" "elasticsearch_policy_attach2" { |
To add another data point, I just checked out and built 5160578 and the problem persists for us:
Here's a snippet of the output. It's subtly different, it no longer says timeout but the errors are on the same entities and it still behaves like a timeout.
|
Hi all! The error message elision here is part of a wider group of issues which is being tracked by a meta-issue over at #5537. However, it looks like there is a wider issue as observed by @bmurphy1976 which needs addressing also, so I will leave this issue open so that we can circle back once #5537 is resolved. |
Hey all – the issue here should be resolved in #5538 – please let us know if you're on the latest master and are still seeing this. Thanks! |
Unless I'm doing something wrong, I'm still seeing this:
Output:
The culprit states look like this:
Am I doing something wrong? Could old state data in the |
My bad, it is working for me now. I neglected to update the version of Terraform inside the docker container where we run our tests. |
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. |
I'm using v0.6.12 and when trying to apply some changes to an environment, i get these errors:
The policies are attached to the role when i check through the web console, so there's so issue with TF figuring this out, as it seems...
The text was updated successfully, but these errors were encountered: