-
-
Notifications
You must be signed in to change notification settings - Fork 127
Add providers
section to Atmos manifests. Update docs
#555
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mcalhoun
approved these changes
Mar 4, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
osterman
approved these changes
Mar 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
what
providers
section to Atmos manifestsprefix
attribute for Atmos components for Terraform backend gcs for GCPwhy
Terraform utilizes plugins known as providers for communication with cloud providers, SaaS providers, and various APIs.
In order for Terraform to install these providers, the corresponding Terraform configurations need to explicitly state what providers are required. Furthermore, certain providers require additional configuration, such as specifying endpoint URLs or cloud regions, before they can be used.
Provider Configuration in Terraform
When working with Terraform, you specify provider configurations in your Terraform code. This involves declaring which providers your infrastructure requires and providing any necessary configuration parameters. These parameters may include endpoint URLs, cloud regions, access credentials, or any other provider-specific configuration parameters.
To declare a provider in Terraform, use a
provider
block within your Terraform configuration files, usually in aproviders.tf
file in the component (a.k.a. root module) directory. Theprovider
block specifies the provider type and all the necessary configuration parameters.Here's an AWS provider configuration example for a
vpc
component. The provider config is defined in thecomponents/terraform/vpc/providers.tf
file:In this example, the
aws
provider block includes the region and IAM role required for Terraform to communicate with the AWS services.By correctly defining provider configurations in your Terraform code, you ensure that Terraform can seamlessly install, configure, and use the necessary plugins to manage your infrastructure across various cloud and services.
Provider Configuration and Overrides in Atmos Manifests
Atmos allows you to define and override provider configurations using the
providers
section in Atmos stack manifests.The section can be defined globally for the entire organization, OU/tenant, account, region, or per component.
For example, the
providers
section at the global scope can look like this:Similarly, it can be defined (or overridden) at the OU/tenant, account and region scopes in the corresponding
_defaults.yaml
stack manifests.If you want to override a provider configuration for a specific component, use the
component.terraform.<component>.providers
section. For example, the following config can be used to override theassume_role
parameter just for thevpc
component:You can include the
providers
sections in any Atmos stack manifest at any level of inheritance. Atmos will process, deep-merge and override all theproviders
configurations for a component in the following order:terraform.providers
sections for the Org, OUs, accounts and regions)component.terraform.<base_component>.providers
section)component.terraform.<component>.providers
section)Refer to Atmos Component Inheritance for more information on all types of component inheritance supported by Atmos.
When you define the
providers
sections, Atmos processes the inheritance chain for a component and generates afile
providers_override.tf.json
in the component's folder with the final values for all the defined providers.For example:
The generated
providers_override.tf.json
file would look like this:Terraform then uses the values in the generated
providers_override.tf.json
to override the parameters for all the providers in the file.References