Allow creating resources for multiple environments in the same account.#120
Open
Allow creating resources for multiple environments in the same account.#120
Conversation
If we're going to be able to have all resources for multiple environments in one account (PR pending), we must make sure that all resources have the environment name in them, so they can be separated.
The AWSBackup/Framework must be unique in the account. As in, it's not possible to create the framework with the same rules etc. Instead, we "import" the "base" framework, and use that where needed.
…ble.
It was included in the main variable for all types, but Aurora.
With a value of:
```
module "source" {
[...]
backup_plan_config_XXX = {
[...]
"selection_tags" : [
{
"key": "Environment"
"value": var.environment
},
{
"key": "Stack"
"value": "rds-cluster"
},
{
"key": "ManagedBy"
"value": "Terraform"
}
]
[...]
}
[...]
}
```
We narrow down the list of resources that the plan etc will find to
only that of the environment (tag `Environment=dev` for example).
Before this commit, it would only look for `selection_tag=selection_tag_value`,
which would catch all resources with that tag set. One could set
different tags for different environments, but that would be confusing
in the long run. Better to have the same tag for the backup, but specify
the environment as well.
10 tasks
4 tasks
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
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.
Description
If there's multiple environment builds in the same account (such as dev, test, non-prod etc), we can't create ALL resources in that account.
Plans and frameworks are account specific, not environment specific.
As in, a plan will have a selection (such as "backup everything with the tag xyz set to abc"). So having separate plans for each env doesn make any sense, they will be identical and backup the same resources.
So introduce a new variable resources_in_same_account which should be set to the account where everything (the "account specific" resources) are created.
Depends on: include_environment_in_resource_names = true.
Depends on: #118
NOTE: In this PR, the #118 PR is included, because it builds on that! That PR needs to be merged before this, which should then be rebased to remove that first commit, before this PR can be merged.
Context
Type of changes
Checklist
Sensitive Information Declaration
To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.