provider-terraform: Does not seem to work with IAM roles for service accounts
What happened?
Get the following error:
Warning CannotObserveExternalResource 6s (x7 over 103s) managed/workspace.tf.crossplane.io cannot diff (i.e. plan) Terraform configuration: error configuring terraform aws provider: no valid credential sources for terraform aws provider found.
How can we reproduce it?
Set the controller config to the following:
apiVersion: pkg.crossplane.io/v1alpha1
kind: ControllerConfig
metadata:
name: terraform-config
labels:
app: crossplane-provider-terraform
annotations:
eks.amazonaws.com/role-arn: arn:aws:iam::<account>:role/<rolename>
spec:
podSecurityContext:
fsGroup: 2000
image: crossplane/provider-terraform-controller:v0.2.0
args: ["-d"]
Can see the annotation however the terraform aws provider does not seem to use it
What environment did it happen in?
Crossplane version: 1.8
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16
That’s a very common place to find an error.
Can you push a PR with the updated text?
This is definitely a bug - can you open a new issue for this and we’ll clean it up or if you want to include it in a doc PR that would be fine too.
Thanks!
@luisdavim We put the same type of role annotation on the controllerconfig for terraform so the pod picks up the native AWS ENV and credentials:
which allows the terraform aws provider to use the default set of credentials. Then when we need the aws provider to use a different account we can use the assume_role configuration.