-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
ASG create fail: ValidationError: valid fully-formed launch template Invalid IAM Instance Profile ARN #24910
Comments
Hey @riddhi89 👋 Thank you for taking the time to raise this! I noticed you mentioned you're using AWS Provider version |
This is still an issue (or has regressed) in I'm seeing the error below when changing the instance profile for an ASG via a launch template.
|
This is still an issue in
|
Reproducer that doesn't work: data "aws_iam_policy_document" "assume" {
statement {
actions = [ "sts:AssumeRole" ]
principals {
type = "Service"
identifiers = [ "ec2.amazonaws.com" ]
}
}
}
resource "aws_iam_role" "this" {
name = "my-role"
assume_role_policy = data.aws_iam_policy_document.assume.json
}
resource "aws_iam_instance_profile" "this" {
name = "my-instance-profile"
role = aws_iam_role.this.name
}
resource "aws_launch_template" "this" {
name = "my-launch-template"
image_id = "ami-0ff8a91507f77f867"
instance_type = "t2.micro"
iam_instance_profile { name = aws_iam_instance_profile.this.name }
}
resource "aws_autoscaling_group" "this" {
name = "my-autoscaling-group"
min_size = 1
max_size = 1
desired_capacity = 1
launch_template { id = aws_launch_template.this.id }
vpc_zone_identifier = [ "subnet-12345678" ]
} The equivalent Amazon CDK works fine and is able to create the auto scaling group fine and attach the instance profile: const vpc = new ec2.Vpc(this, "Vpc")
new autoscaling.AutoScalingGroup(this, "AutoScalingGroup", {
vpc,
launchTemplate: new ec2.LaunchTemplate(this, "LaunchTemplate", {
machineImage: new ec2.AmazonLinuxImage(),
instanceType: new ec2.InstanceType("t2.micro"),
instanceProfile: new iam.InstanceProfile(this, "InstanceProfile"),
}),
}) |
@justinretzolk Bump on this please, this is preventing us from fixing issues currently |
Warning This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them. Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed. |
This functionality has been released in v5.76.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. Thank you! |
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. |
Community Note
Error:
Terraform CLI and Terraform AWS Provider Version
Terraform version: 0.12.23
Terraform AWS Provider Version: v2.70.0
Affected Resource(s)
aws_iam_instance_profile
aws_launch_template
aws_autoscaling_group
Repeat of an earlier reported issue
Similar Terraform configuration, behavior and error as reported in #5217
The issue was fixed in 1.34.0 (#5633)
Could we consider bumping the propagation timeout to mitigate this further? https://github.com/hashicorp/terraform-provider-aws/blob/main/internal/service/autoscaling/consts.go#L10
The text was updated successfully, but these errors were encountered: