-
Notifications
You must be signed in to change notification settings - Fork 65
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
(1/4) Create an IAM Role with relevant permissions (IAM Policy) #4547
Comments
I am running into the following error trying to create the IAM role and policy
I have tried adding |
Solution may be to remove the |
Removed resource from the first statement, and now terraform is saying I need a
|
I'm getting the same set of errors on each item in the statement, so I'm going to stop working on this for now and not it in the bot stand-up. |
One last thing I tried was a |
@sgibson91, you're getting these errors when you're trying to apply right 🤔 ? Cause for me, the terraform plan looks clean. COnfirmed that yes, they happen on apply |
I've added a few commits to #4560. The relevant ones:
I'm not entirely sure that the irsa part works, as I copy-pasted from existing code and I'm not sure that I've got everything right. I guess, doing #4548 next might answer this question. Terraform apply worked, and all the boxes in the definition of done can be checked, so I'll close this issue once I merged the PR and come back to it if it proves to not be working. |
This is task 1/4 in #4546, which is part of the big epic #4453.
In task 2/4 (#4548) we'll expose credentials to Grafana using an IAM Role with an attached IAM Policy granting relevant permissions for grafana to work against Athena. This task is to create such IAM Role with attached IAM Policy using terraform.
Create an IAM Role via terraform
In
terraform/aws
, create a new file named for example asgrafana-athena-iam.tf
or similar. Define a newaws_iam_role
resource, for example by adjusting the basic example in the associated docs.Make this resource be opt-in by introducing a terraform variable only terraform/aws/projects/openscapes.tfvars makes use of, so that other terraform projects are unaffected by this change.
Attach or inline an IAM Policy
For the IAM Policy declaring the permissions the IAM Role should be granted, make use the policy defined in the grafana-athena-datasource documentation at for now. Maybe it works out of the box, maybe it doesn't. Let's try to remember it may need to be tweaked in the future, but settle for this for now.
Create a terraform output for the IAM Role's ARN
We'll want to be able to reference the ARN (unique identifier) of the IAM Role later. To make that easy, define a terraform output (docs about it here).
I think
aws_iam_role.<terraform resource name>.arn
can be referenced to get the relevant arn.Definition of done
terraform apply ...
provided anarn
output.terraform plan
to a non-openscapes project isn't influenced by the changes and can keep functioning.If
terraform apply
succeeds, you should be able to see the IAM Role listed through the AWS web console (openscapes login here) by navigating toIAM -> Roles
. Make sure you can see it listed here, and verify its associated with the IAM policy as well.The text was updated successfully, but these errors were encountered: