Hi everyone, I have a question regarding all modul...
# geodesic
m
Hi everyone, I have a question regarding all modules in
aws-terraform-component
. In most of this modules you require the module
iam-roles
. But you call it with few parameters:
Copy code
module "iam_roles" {    
  source      = "../account-map/modules/iam-roles"    
  stage       = var.stage    
  assume_role = false    
  region      = var.region  
}
But this module need other information to access remote state of account-map. Like the account id, the namespace or the bucket envirnoment_name. I think someting like that can work:
Copy code
module "iam_roles" {
  source      = "../account-map/modules/iam-roles"
  stage       = var.stage
  tfstate_assume_role = false
  tfstate_bucket_environment_name = var.tfstate_bucket_environment_name
  region      = var.region
  context     = module.this.context
  tfstate_account_id = var.tfstate_account_id
}
Or maybe you have a way in atmos to pass this variables to the module directly. Thanks
j
@Matt Gowie this is one of the things I ran into and had a question about as well. I did the same thing as Mathieu. Is the longer term intent to do something like
terraform-null-label
but for the tfstate-context?
m
Ah yeah the
<http://tfstate-context.tf|tfstate-context.tf>
files was a pattern that I believe the CP team tried out, but it didn’t work out and was deprecated.
j
I see, thanks. Do you know if there is something more up to date that I should look at?
m
@Mathieu SERRA @Joe Hosteny The issue with the above usage of iam_roles is that the account-map version likely doesn’t have the latest iam_roles submodule which causes issues. We need to get everything up-to-date and get it all working together which unfortunately we’re waiting on PR reviews and some time from some of the more in-the-know Cloud Posse team members.
j
Thanks @Matt Gowie. Not sure if you caught my message above while you were typing out your last one. Or maybe you meant that was part of the pending work?
m
I believe it’s like just a disconnect between the pending work and what has merged. Let me check again what has merged so I know which direction it is borked in.
Yeah so I believe the issue is likely that these components haven’t landed yet: https://github.com/cloudposse/terraform-aws-components/pull/304
Once those are merged in, we’ll have the most up-to-date iam_roles submodule and then things start to fit together better.
j
Thanks! I may try to merge those into my local repo
m
Honestly… I believe we’re going to need to pull that submodule out and start versioning submodule usage instead of relying on path based modules because these types of issues crop up.
cc @Erik Osterman (Cloud Posse) for discussion / context later.
Also we need a #sweetops channel 😅 Talking about this in #CB84E9V54 aint right.
(It’s the best we’ve got, but we need a better spot to talk about atmos, stacks, components, and all the things)
j
Yeah, sorry - I think I saw some other discussions regarding the new structure here.
m
Ah nothing to be sorry about — Really thinking out loud more than anything.
j
BTW, I was working from the
all-new-components
branch. I diff'ed a lot of the changes between that and the
upstream-account-comps
branch, and wound up just deleting the tfstate-context.tf and tfstate.tf files from the
account-map
component, and everything worked cleanly
👍 1
With applying twice (first time w/
assume_role_restricted: false
)