Conversation
📝 WalkthroughWalkthroughresolveInfraResource in engines/terraform/deployment.go now creates a local Suggested reviewers
Pre-merge checks✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
resources updated - fargate, lambda, loadbalancer, vpc relies on - nitrictech/monk#103 which injects the stack_id
resources updated - fargate, lambda, loadbalancer, vpc, cloudfront relies on - nitrictech/monk#103 which injects the stack_id
Adds the `suga` variable containing infrastructure name and stack ID to the Terraform module configuration. Required to create unique names for these resources in the Terraform.
resources updated - fargate, lambda, loadbalancer, vpc, cloudfront relies on - nitrictech/monk#103 which injects the stack_id
resources updated - fargate, lambda, loadbalancer, vpc, cloudfront relies on - nitrictech/monk#103 which injects the stack_id
resources updated - fargate, lambda, loadbalancer, vpc, cloudfront, security group relies on - nitrictech/monk#103 which injects the stack_id
| sugaVar := map[string]any{ | ||
| "stack_id": td.stackId.Result(), | ||
| } | ||
|
|
||
| td.terraformInfraResources[infraName] = cdktf.NewTerraformHclModule(td.stack, jsii.String(infraName), &cdktf.TerraformHclModuleConfig{ | ||
| Source: jsii.String(pluginRef.Deployment.Terraform), | ||
| Variables: &map[string]interface{}{ | ||
| "suga": sugaVar, | ||
| }, | ||
| }) | ||
| } |
There was a problem hiding this comment.
Originally the idea behind not including this was to allow any existing terraform module to be made into infra modules without any additional HCL wrapping. As far as unique naming goes at the moment this can be delegated to SREs (or whoever is performing the apply) by forwarding the name using variables.
Not saying we don't include this by the way, just sharing the original thinking behind not including suga vars for infra.
There was a problem hiding this comment.
yeh lets discuss, I knew that the original intent was to keep suga specific things out of the infra modules - but its not possible to deploy multiple projects that use the same platform config.
There was a problem hiding this comment.
I suppose we could create variables in the default platforms that accept a prefix?
There was a problem hiding this comment.
right, that would be the way to do it currently, could potentially use a few variables as well. e.g.
${var.project_name}-${var.environment_name}-vpc as an example. Built-in variables are also possible.
e.g. ${var.project_name}-${terraform.workspace}, although it might be better to default for those rather than make an assumption i.e. var.environment_name == terraform.workspace as a potential default.
|
Okay, I'll pull these and update my platform to use variables. |
Adds the
sugavariable containing infrastructure name and stack ID to the Terraform module configuration.Required to create unique names for these resources in their respective terraform module implementations.