feat(aws): add Hero host-config SOPS identity - #52
Merged
Conversation
Contributor
OpenTofu TestOpenTofu test passed. View run output |
Contributor
OpenTofu PlanOpenTofu plan passed. View run outputOpenTofu will perform the following actions:
[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
+ arn = (known after apply)
+ assume_role_policy = jsonencode(
{
+ Statement = [
+ {
+ Action = "sts:AssumeRoleWithWebIdentity"
+ Condition = {
+ StringEquals = {
[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
}
}
+ Effect = "Allow"
+ Principal = {
[REDACTED: potentially sensitive plan output]
}
},
]
+ Version = "2012-10-17"
}
)
+ create_date = (known after apply)
+ force_detach_policies = false
+ id = (known after apply)
+ managed_policy_arns = (known after apply)
+ max_session_duration = 3600
[REDACTED: potentially sensitive plan output]
+ name_prefix = (known after apply)
+ path = "/"
+ tags = {
+ "ManagedBy" = "Terraform"
[REDACTED: potentially sensitive plan output]
}
+ tags_all = {
+ "ManagedBy" = "Terraform"
[REDACTED: potentially sensitive plan output]
}
+ unique_id = (known after apply)
+ inline_policy (known after apply)
}
[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
+ id = (known after apply)
[REDACTED: potentially sensitive plan output]
+ name_prefix = (known after apply)
+ policy = (known after apply)
+ role = (known after apply)
}
[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
+ arn = (known after apply)
+ id = (known after apply)
[REDACTED: potentially sensitive plan output]
+ name_prefix = (known after apply)
+ region = "us-west-2"
+ target_key_arn = (known after apply)
+ target_key_id = (known after apply)
}
[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
+ arn = (known after apply)
+ bypass_policy_lockout_safety_check = false
+ customer_master_key_spec = "SYMMETRIC_DEFAULT"
+ deletion_window_in_days = 30
[REDACTED: potentially sensitive plan output]
+ enable_key_rotation = true
+ id = (known after apply)
+ is_enabled = true
+ key_id = (known after apply)
+ key_usage = "ENCRYPT_DECRYPT"
+ multi_region = (known after apply)
+ policy = (known after apply)
+ region = "us-west-2"
+ rotation_period_in_days = (known after apply)
+ tags = {
+ "ManagedBy" = "Terraform"
[REDACTED: potentially sensitive plan output]
}
+ tags_all = {
+ "ManagedBy" = "Terraform"
[REDACTED: potentially sensitive plan output]
}
}
Plan: 4 to add, 0 to change, 0 to destroy.
OpenTofu will perform the following actions:
[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
+ arn = (known after apply)
+ assume_role_policy = jsonencode(
{
+ Statement = [
+ {
+ Action = "sts:AssumeRoleWithWebIdentity"
+ Condition = {
+ StringEquals = {
[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
}
}
+ Effect = "Allow"
+ Principal = {
[REDACTED: potentially sensitive plan output]
}
},
]
+ Version = "2012-10-17"
}
)
+ create_date = (known after apply)
+ force_detach_policies = false
+ id = (known after apply)
+ managed_policy_arns = (known after apply)
+ max_session_duration = 3600
[REDACTED: potentially sensitive plan output]
+ name_prefix = (known after apply)
+ path = "/"
+ tags = {
+ "ManagedBy" = "Terraform"
[REDACTED: potentially sensitive plan output]
}
+ tags_all = {
+ "ManagedBy" = "Terraform"
[REDACTED: potentially sensitive plan output]
}
+ unique_id = (known after apply)
+ inline_policy (known after apply)
}
[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
+ id = (known after apply)
[REDACTED: potentially sensitive plan output]
+ name_prefix = (known after apply)
+ policy = (known after apply)
+ role = (known after apply)
}
[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
+ arn = (known after apply)
+ id = (known after apply)
[REDACTED: potentially sensitive plan output]
+ name_prefix = (known after apply)
+ region = "us-west-2"
+ target_key_arn = (known after apply)
+ target_key_id = (known after apply)
}
[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
+ arn = (known after apply)
+ bypass_policy_lockout_safety_check = false
+ customer_master_key_spec = "SYMMETRIC_DEFAULT"
+ deletion_window_in_days = 30
[REDACTED: potentially sensitive plan output]
+ enable_key_rotation = true
+ id = (known after apply)
+ is_enabled = true
+ key_id = (known after apply)
+ key_usage = "ENCRYPT_DECRYPT"
+ multi_region = (known after apply)
+ policy = (known after apply)
+ region = "us-west-2"
+ rotation_period_in_days = (known after apply)
+ tags = {
+ "ManagedBy" = "Terraform"
[REDACTED: potentially sensitive plan output]
}
+ tags_all = {
+ "ManagedBy" = "Terraform"
[REDACTED: potentially sensitive plan output]
}
}
Plan: 4 to add, 0 to change, 0 to destroy. |
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.
Summary
Creates a dedicated AWS KMS recipient and a main-only GitHub OIDC decrypt role for
hero-host-config. This is the least-privilege prerequisite for that repository's future SOPS-encrypted Cloudflared configuration, credential material, and Ansible management key.No S3 bucket or Secrets Manager secret is added: the intended secret source is Git-native SOPS ciphertext, encrypted with this dedicated KMS key. The existing shared SOPS role and key are unchanged.
Fixes #
None — owner-authorized Hero host-management bootstrap work.
Type of change
Validation
opentofu / testandopentofu / plansucceeded.README.mdafter adding the OpenTofu resources and outputs.No local OpenTofu init, plan, apply, import, state, or secret-decryption operation was run or claimed.
Impact and rollout
Producer:
tfroot-awswill own the dedicated KMS key, alias, and OIDC role.Consumers: after a successful environment-gated apply,
hero-host-configmay use the KMS key as its SOPS recipient, and only itsmainGitHub Actions workflow may assume the new role to decrypt that repository's SOPS data.tfroot-githubandtfroot-cloudflareremain separate producers for the future dedicated WARP enrollment credentials.Delivery stages: authored and CI-validated on this branch. Merge, environment-gated apply, KMS/role creation, encrypted-secret migration, WARP enrollment, host bootstrap, and Node Exporter deployment remain incomplete.
Rollback: before apply, close or revert this PR. After apply, do not blindly remove the key: it has
prevent_destroyand a 30-day deletion window. Make an explicit retention and ciphertext-migration decision first.Safety and secrets
AI-assisted change: an OpenCode agent materially prepared this branch and pull request. Review the OIDC trust subject, main-only decrypt boundary, key-retention settings, generated README update, and absence of an unnecessary S3 or Secrets Manager backend before merge.