-
Notifications
You must be signed in to change notification settings - Fork 19
add option to pass tags as parameter to apply to aws resources #10
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
Open
vamsinm
wants to merge
4
commits into
terraform-redhat:main
Choose a base branch
from
StateFarmIns:tag-parameter
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
86be15d
add option to pass tags as parameter to apply to aws resources
vamsinm 3e36a7c
updated aws->AWS and added example code and inputs table to all read …
vamsinm 1aa0104
fixed aws in operator_roles_creation readme
vamsinm 43eb2c1
updates sample usage readme files in sub moudles with tags example
vamsinm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,7 +36,19 @@ This terraform module tries to replicate rosa CLI roles creation so that: | |
| |ocm_environment| string | the OCM environments. The value should be one of those: production, staging, integration, local | "production" | | ||
| |account_role_policies| object | account role policies details for account roles creation | [an example can be found below](https://github.com/terraform-redhat/terraform-aws-rosa-sts/tree/use_data_source_for_account_policies/account_roles_creation#account_role_policies-object) | | ||
| |operator_role_policies| object | operator role policies details for operator role policies creation | [an example can be found below](https://github.com/terraform-redhat/terraform-aws-rosa-sts/tree/use_data_source_for_account_policies/account_roles_creation#operator_role_policies-object) | | ||
| |tags | map of strings |List of AWS resource tags to apply | [an example can be found below](#tags-object) | | ||
|
|
||
| ### tags object | ||
| `tags` is a map of strings with resource tags to be applied to AWS resources created. | ||
| The map looks like: | ||
| ``` | ||
| { | ||
| contact = "[email protected]" | ||
| cost-center = "12345" | ||
| owner = "productteam" | ||
| environment = "test" | ||
| } | ||
| ``` | ||
|
|
||
| ## Get OCM Information for operator roles and OIDC provider | ||
|
|
||
|
|
@@ -168,6 +180,14 @@ module "create_account_roles"{ | |
| rosa_openshift_version = var.rosa_openshift_version | ||
| account_role_policies = var.account_role_policies | ||
| operator_role_policies = var.operator_role_policies | ||
|
|
||
| #optional | ||
| tags = { | ||
| contact = "[email protected]" | ||
| cost-center = "12345" | ||
| owner = "productteam" | ||
| environment = "test" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
|
|
@@ -191,6 +211,14 @@ module operator_roles { | |
| rh_oidc_provider_thumbprint = ocm_cluster_rosa_classic.rosa_sts_cluster.sts.thumbprint | ||
| rh_oidc_provider_url = ocm_cluster_rosa_classic.rosa_sts_cluster.sts.oidc_endpoint_url | ||
| operator_roles_properties = data.ocm_rosa_operator_roles.operator_roles.operator_iam_roles | ||
|
|
||
| #optional | ||
| tags = { | ||
| contact = "[email protected]" | ||
| cost-center = "12345" | ||
| owner = "productteam" | ||
| environment = "test" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,19 @@ Terraform AWS ROSA STS | |
| |ocm_environment| string | the OCM environments. The value should be one of those: production, staging, integration, local | "production" | | ||
| |account_role_policies| object | account role policies details for account roles creation | [an example can be found below](https://github.com/terraform-redhat/terraform-aws-rosa-sts/tree/use_data_source_for_account_policies/account_roles_creation#account_role_policies-object) | | ||
| |operator_role_policies| object | operator role policies details for operator role policies creation | [an example can be found below](https://github.com/terraform-redhat/terraform-aws-rosa-sts/tree/use_data_source_for_account_policies/account_roles_creation#operator_role_policies-object) | | ||
| |tags | map of strings | List of AWS resource tags to apply | [an example can be found below](#tags-object) | | ||
|
|
||
| ### tags object | ||
| `tags` is a map of strings with resource tags to be applied to AWS resources created. | ||
| The map looks like: | ||
| ``` | ||
| { | ||
| contact = "[email protected]" | ||
| cost-center = "12345" | ||
| owner = "productteam" | ||
| environment = "test" | ||
| } | ||
| ``` | ||
|
|
||
| ### account_role_policies object | ||
| `account_role_policies` is an object that holds the policy details for each account role. | ||
|
|
@@ -53,18 +66,26 @@ The object looks like: | |
|
|
||
| ``` | ||
| module "create_account_roles"{ | ||
| source = "terraform-redhat/rosa-sts/aws" | ||
| version = ">=0.0.3" | ||
| source = "terraform-redhat/rosa-sts/aws" | ||
| version = ">=0.0.3" | ||
|
|
||
| create_operator_roles = false | ||
| create_oidc_provider = false | ||
| create_account_roles = true | ||
|
|
||
| create_operator_roles = false | ||
| create_oidc_provider = false | ||
| create_account_roles = true | ||
| account_role_prefix = var.account_role_prefix | ||
| ocm_environment = var.ocm_environment | ||
| rosa_openshift_version = var.rosa_openshift_version | ||
| account_role_policies = var.account_role_policies | ||
| operator_role_policies = var.operator_role_policies | ||
|
|
||
| account_role_prefix = var.account_role_prefix | ||
| ocm_environment = var.ocm_environment | ||
| rosa_openshift_version = var.rosa_openshift_version | ||
| account_role_policies = var.account_role_policies | ||
| operator_role_policies = var.operator_role_policies | ||
| #optional | ||
| tags = { | ||
| contact = "[email protected]" | ||
| cost-center = "12345" | ||
| owner = "productteam" | ||
| environment = "test" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
|
|
||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,30 +1,36 @@ | ||
| variable account_role_prefix { | ||
| type = string | ||
| variable "account_role_prefix" { | ||
| type = string | ||
| } | ||
|
|
||
| variable account_role_properties { | ||
| description = "Account IAM role properties" | ||
| type = object({ | ||
| role_name = string | ||
| role_type = string | ||
| principal = string | ||
| policy_details = string | ||
| }) | ||
| variable "account_role_properties" { | ||
| description = "Account IAM role properties" | ||
| type = object({ | ||
| role_name = string | ||
| role_type = string | ||
| principal = string | ||
| policy_details = string | ||
| }) | ||
| } | ||
|
|
||
| variable instance_account_role_properties { | ||
| description = "Account IAM role properties" | ||
| type = object({ | ||
| role_name = string | ||
| role_type = string | ||
| policy_details = string | ||
| }) | ||
| variable "instance_account_role_properties" { | ||
| description = "Account IAM role properties" | ||
| type = object({ | ||
| role_name = string | ||
| role_type = string | ||
| policy_details = string | ||
| }) | ||
| } | ||
|
|
||
| variable rosa_openshift_version { | ||
| type = string | ||
| default = "4.12" | ||
| variable "rosa_openshift_version" { | ||
| type = string | ||
| default = "4.12" | ||
| } | ||
| variable "account_id" { | ||
| type = string | ||
| } | ||
|
|
||
| variable "tags" { | ||
| description = "List of AWS resource tags to apply." | ||
| type = map(string) | ||
| default = null | ||
| } | ||
| variable account_id { | ||
| type = string | ||
| } |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.