-
Notifications
You must be signed in to change notification settings - Fork 22
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 Cloud Integration is not always created #42
Comments
Dear rfisher-centrica. Would you kindly send the main.tf you are using? Having your main.tf file will help me reproduce this issue. |
Here it is. I think you should be able to work out suitable variables. The name = var.iam_role_name
tags = {
"Environment" = terraform.workspace
"ServiceName" = "Cloud Management",
"ServiceOwner" = "Sre",
"ServiceRole" = "WavefrontIntegration"
}
assume_role_policy = <<POLICY
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::${var.wavefront_aws_account_id}:root"
},
"Action": "sts:AssumeRole",
"Condition": {
"StringEquals": {
"sts:ExternalId": "${wavefront_cloud_integration_aws_external_id.external_id.id}"
}
}
}
]
}
POLICY
}
resource aws_iam_role_policy_attachment read-only {
role = aws_iam_role.wavefront.name
policy_arn = "arn:aws:iam::aws:policy/ReadOnlyAccess"
}
resource wavefront_cloud_integration_aws_external_id external_id {}
resource time_sleep sleep {
create_duration = "60s"
triggers = {
wavefront_role_arn = aws_iam_role.wavefront.arn
wavefront_role_policy = aws_iam_role.wavefront.assume_role_policy
}
}
resource wavefront_cloud_integration_cloudwatch cloudwatch {
name = var.cloud_integration_name
role_arn = time_sleep.sleep.triggers["wavefront_role_arn"]
external_id = wavefront_cloud_integration_aws_external_id.external_id.id
metric_filter_regex = var.metric_filter_regex
point_tag_filter_regex = var.point_tag_filter_regex
service_refresh_rate_in_minutes = var.service_refresh_rate_in_mins
force_save = false
}
resource wavefront_cloud_integration_ec2 ec2 {
external_id = wavefront_cloud_integration_aws_external_id.external_id.id
name = var.cloud_integration_name
role_arn = time_sleep.sleep.triggers["wavefront_role_arn"]
service_refresh_rate_in_minutes = var.service_refresh_rate_in_mins
hostname_tags = ["host", "source", "name"]
force_save = false
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We often see this error in our pipeline.
This appears to be because Terraform is trying to create the integration before the job to create the IAM role is complete in AWS.
The text was updated successfully, but these errors were encountered: