Skip to content

Commit a0b5eff

Browse files
authored
fix: reverting the multiple repository feature, as it needs more thought (#75)
1 parent 14f0c52 commit a0b5eff

9 files changed

Lines changed: 6 additions & 55 deletions

File tree

examples/repositories/README.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

examples/repositories/main.tf

Lines changed: 0 additions & 18 deletions
This file was deleted.

examples/repositories/outputs.tf

Whitespace-only changes.

examples/repositories/terraform.tf

Lines changed: 0 additions & 11 deletions
This file was deleted.

examples/repositories/variables.tf

Whitespace-only changes.

modules/role/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,6 @@ No modules.
598598
| <a name="input_read_write_max_session_duration"></a> [read\_write\_max\_session\_duration](#input\_read\_write\_max\_session\_duration) | The maximum session duration (in seconds) that you want to set for the specified role | `number` | `null` | no |
599599
| <a name="input_read_write_policy_arns"></a> [read\_write\_policy\_arns](#input\_read\_write\_policy\_arns) | List of IAM policy ARNs to attach to the read-write role | `list(string)` | `[]` | no |
600600
| <a name="input_region"></a> [region](#input\_region) | The region in which the role will be used (defaulting to the provider region) | `string` | `null` | no |
601-
| <a name="input_repositories"></a> [repositories](#input\_repositories) | A collection of repositories to to bind the permissions | `list(string)` | `[]` | no |
602601
| <a name="input_repository"></a> [repository](#input\_repository) | Repository to be allowed in the OIDC federation mapping | `string` | `null` | no |
603602
| <a name="input_role_path"></a> [role\_path](#input\_role\_path) | Path under which to create IAM role. | `string` | `null` | no |
604603
| <a name="input_shared_repositories"></a> [shared\_repositories](#input\_shared\_repositories) | List of repositories to provide read access to the remote state | `list(string)` | `[]` | no |

modules/role/locals.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ locals {
3939
# The region where the iam role will be used
4040
region = var.region != null ? var.region : data.aws_region.current.region
4141
## The list of repositories to create roles for
42-
repositories = compact(concat([var.repository], var.repositories))
42+
repositories = compact(concat([var.repository], []))
4343
# Find the source control provider from supplied list
4444
common_provider = lookup(local.common_providers, var.common_provider, null)
4545
# The selected provider from the supplied list
4646
selected_provider = var.custom_provider != null ? var.custom_provider : local.common_provider
4747
# Extract just the repository name part of the full path
48-
#repo_name = element(split("/", var.repository), length(split("/", var.repository)) - 1)
48+
repository_name = element(split("/", var.repository), length(split("/", var.repository)) - 1)
4949
# Keys to search for in the subject mapping template
5050
template_keys_regex = "{(repo|type|ref|env)}"
5151
# The prefix for the terraform state key in the S3 bucket

modules/role/policies.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
locals {
22
# The default state key is PREFIX + REPOSITORY_NAME + .tfstate
3-
default_state_key = format("arn:aws:s3:::%s-tfstate/%s%s.tfstate", local.tf_state_bucket, var.name, local.tf_state_suffix)
3+
default_state_key = format("arn:aws:s3:::%s-tfstate/%s%s.tfstate", local.tf_state_bucket, local.repository_name, local.tf_state_suffix)
44
# Is the default state lock file key
5-
default_state_lock_file_key = format("arn:aws:s3:::%s-tfstate/%s%s.tfstate.tflock", local.tf_state_bucket, var.name, local.tf_state_suffix)
5+
default_state_lock_file_key = format("arn:aws:s3:::%s-tfstate/%s%s.tfstate.tflock", local.tf_state_bucket, local.repository_name, local.tf_state_suffix)
66

77
# The default state prefix when using the entire namespace is PREFIX + REPOSITORY_NAME + /*
8-
default_state_namespace_key = format("arn:aws:s3:::%s-tfstate/%s%s/*", local.tf_state_bucket, var.name, local.tf_state_suffix)
8+
default_state_namespace_key = format("arn:aws:s3:::%s-tfstate/%s%s/*", local.tf_state_bucket, local.repository_name, local.tf_state_suffix)
99
# The prefix for the lock file
10-
default_state_namespace_lock_file_key = format("arn:aws:s3:::%s-tfstate/%s%s/*.tfstate.tflock", local.tf_state_bucket, var.name, local.tf_state_suffix)
10+
default_state_namespace_lock_file_key = format("arn:aws:s3:::%s-tfstate/%s%s/*.tfstate.tflock", local.tf_state_bucket, local.repository_name, local.tf_state_suffix)
1111

1212
# Is the prefix for the terraform state key, by default this is PREFIX + REPOSITORY_NAME + .tfstate.
1313
# However, when the entire namespace is enabled, this is PREFIX + REPOSITORY_NAME + /*

modules/role/variables.tf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,6 @@ variable "repository" {
8282
default = null
8383
}
8484

85-
variable "repositories" {
86-
description = "A collection of repositories to to bind the permissions"
87-
type = list(string)
88-
default = []
89-
}
90-
9185
variable "shared_repositories" {
9286
description = "List of repositories to provide read access to the remote state"
9387
type = list(string)

0 commit comments

Comments
 (0)