Repository navigation
feat(aws): isolate OpenCode US Ergo inference identity - #61
Merged
Merged
Conversation
Contributor
OpenTofu TestOpenTofu test passed. View run output |
Contributor
OpenTofu PlanOpenTofu plan passed. View run outputOpenTofu will perform the following actions:
# aws_iam_user.opencode_ergo will be created
+ resource "aws_iam_user" "opencode_ergo" {
+ arn = (known after apply)
+ force_destroy = false
+ id = (known after apply)
+ name = "opencode-ergo"
+ path = "/"
+ tags = {
+ "ManagedBy" = "Terraform"
+ "Purpose" = "opencode-ergo-inference"
}
+ tags_all = {
+ "ManagedBy" = "Terraform"
+ "Purpose" = "opencode-ergo-inference"
}
+ unique_id = (known after apply)
}
# aws_iam_user_policy.opencode_ergo will be created
+ resource "aws_iam_user_policy" "opencode_ergo" {
+ id = (known after apply)
+ name = "opencode-ergo-us-inference"
+ name_prefix = (known after apply)
+ policy = jsonencode(
{
+ Statement = [
+ {
+ Action = [
+ "bedrock:InvokeModel",
+ "bedrock:InvokeModelWithResponseStream",
]
+ Effect = "Allow"
+ Resource = "arn:aws:bedrock:us-west-2:332355796717:inference-profile/us.amazon.ergo-1.0"
+ Sid = "InvokeUsErgoProfile"
},
+ {
+ Action = [
+ "bedrock:InvokeModel",
+ "bedrock:InvokeModelWithResponseStream",
]
+ Condition = {
+ StringEquals = {
+ "bedrock:InferenceProfileArn" = "arn:aws:bedrock:us-west-2:332355796717:inference-profile/us.amazon.ergo-1.0"
}
}
+ Effect = "Allow"
+ Resource = "arn:aws:bedrock:us-east-2::foundation-model/amazon.ergo-1.0"
+ Sid = "AllowErgoDestinationOnlyThroughProfile"
},
]
+ Version = "2012-10-17"
}
)
+ user = "opencode-ergo"
}
Plan: 2 to add, 0 to change, 0 to destroy.
OpenTofu will perform the following actions:
# aws_iam_user.opencode_ergo will be created
+ resource "aws_iam_user" "opencode_ergo" {
+ arn = (known after apply)
+ force_destroy = false
+ id = (known after apply)
+ name = "opencode-ergo"
+ path = "/"
+ tags = {
+ "ManagedBy" = "Terraform"
+ "Purpose" = "opencode-ergo-inference"
}
+ tags_all = {
+ "ManagedBy" = "Terraform"
+ "Purpose" = "opencode-ergo-inference"
}
+ unique_id = (known after apply)
}
# aws_iam_user_policy.opencode_ergo will be created
+ resource "aws_iam_user_policy" "opencode_ergo" {
+ id = (known after apply)
+ name = "opencode-ergo-us-inference"
+ name_prefix = (known after apply)
+ policy = jsonencode(
{
+ Statement = [
+ {
+ Action = [
+ "bedrock:InvokeModel",
+ "bedrock:InvokeModelWithResponseStream",
]
+ Effect = "Allow"
+ Resource = "arn:aws:bedrock:us-west-2:332355796717:inference-profile/us.amazon.ergo-1.0"
+ Sid = "InvokeUsErgoProfile"
},
+ {
+ Action = [
+ "bedrock:InvokeModel",
+ "bedrock:InvokeModelWithResponseStream",
]
+ Condition = {
+ StringEquals = {
+ "bedrock:InferenceProfileArn" = "arn:aws:bedrock:us-west-2:332355796717:inference-profile/us.amazon.ergo-1.0"
}
}
+ Effect = "Allow"
+ Resource = "arn:aws:bedrock:us-east-2::foundation-model/amazon.ergo-1.0"
+ Sid = "AllowErgoDestinationOnlyThroughProfile"
},
]
+ Version = "2012-10-17"
}
)
+ user = "opencode-ergo"
}
Plan: 2 to add, 0 to change, 0 to destroy. |
4 of 5 tasks
xnoto
added a commit
to makeitworkcloud/kustomize-cluster
that referenced
this pull request
Dec 2, 2026
## Summary Stage the operator-supplied SOPS Secret for the dedicated US Ergo identity from makeitworkcloud/tfroot-aws#61. Add the manifest and register it with the existing OpenCode KSOPS generator. This draft does not change the chart, deployment settings, or model availability. ## Type of change - [x] GitOps desired state (manifests, kustomize, charts, SOPS/KSOPS secrets) ## Validation - [x] Required pull-request checks pass - [x] Authorized operator reports the KSOPS validation passed for the proposed change (operator attestation; not independently rerun). PR CI cannot decrypt the full KSOPS overlay; green CI is not proof of decryptability or manifest correctness. The operator confirmed both expected fields have SOPS encryption markers. GitHub blob metadata confirms the manifest is unchanged from the operator-checked revision. The manifest contents were not independently reviewed. ## Impact and rollout Opening this PR did not deploy. After validation and separate explicit merge approval, Argo CD can reconcile the Secret in the OpenCode namespace. Verify the merged revision, Secret metadata, and application health. Chart wiring, provider enablement, and inference checks remain separate. If the registration fails to reconcile, use a reviewed GitOps revert; do not alter live state manually. ## Safety and secrets - [ ] Authorized reviewer confirms the manifest has no plaintext credentials or other prohibited material - [x] No local OpenTofu operations were run AI-assisted generator wiring and PR preparation. Do not include credential material in review notes.
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
Prepare a dedicated, initially keyless IAM user for the separately credentialed OpenCode pilot. Grant only streaming and non-streaming Bedrock invocation for the US Ergo profile in us-west-2 and its Ohio backing model when authorized through that profile. Scope follows the AWS model card and profile IAM prerequisites.
Type of change
Validation
Static diff and IAM scope reviewed. PR CI is authoritative; expect two additions (IAM user and its inline policy), without unrelated changes or deletes. No live tests in this PR.
Impact and rollout
No existing AWS MCP or OpenCode runtime changes. After a separately approved merge and environment-gated apply, key issuance, encrypted delivery, chart wiring and GitOps enablement are separate steps. No key in Terraform. Before activation, verify successful US Ergo inference and denial for unrelated profiles/direct invocation. Roll back an eventual activation by disabling the provider and revoking its dedicated credential before removing the identity.
Safety and secrets
AI-authored; independently reviewed for code and infrastructure security.