Repository navigation
Sync environments: primary domain, dedicated cluster and AWS role - #309
Open
joetannenbaum wants to merge 2 commits into
Open
joetannenbaum wants to merge 2 commits into
joetannenbaum wants to merge 2 commits into
Conversation
The API now sets and clears an environment's primary domain
(PUT and DELETE /environments/{environment}/primary-domain). The new
command takes --domain (ID or name) or --clear, and interactively offers
the environment's root domains plus an option to clear.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T1Sq4WQ3L3cL3CyKM4B8P4
The environment resource now carries `cluster_id`, `aws_role_arn` and
`aws_trust_policy`, and `PATCH /environments/{environment}` accepts
`aws_role_arn`. The DTO exposes all three; `environment:update` takes
`--aws-role-arn` (empty removes it) and offers it interactively only for
an environment on a dedicated cluster.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T1Sq4Yc6BQ4S3vcDD6eqZ6
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.
Syncs environments with the current API spec: adds
environment:primary-domainfor the two new primary-domain endpoints, and picks up the dedicated cluster and AWS role fields the environment resource and update now carry.Findings
PUT /environments/{environment}/primary-domaindomain_id(required), which must be a verified root domain on the environment that doesn't redirect to another domain. Answers 200 withEnvironmentResource.DELETE /environments/{environment}/primary-domainEnvironmentResource.attributes.cluster_idstring | null: the dedicated cluster the environment runs on,nullon shared compute.--json/--fieldscouldn't show itEnvironmentResource.attributes.aws_role_arnstring | null: the IAM role the application assumes. Only present for an environment on a dedicated cluster, in an organization with bring your own IAM role enabled.EnvironmentResource.attributes.aws_trust_policystring: the trust policy, as JSON, the role inaws_role_arnmust have. Present whenaws_role_arnis.UpdateEnvironmentRequest.aws_role_arnstring | null: sets the role; "Send null to remove the role." Only for an environment on a dedicated cluster with bring your own IAM role; applies on the next deployment.Both primary-domain endpoints need the
environment_domain.editpermission.Changes
environment:primary-domainUpdatePrimaryDomainRequest(withUpdateEnvironmentPrimaryDomainRequestData) andClearPrimaryDomainRequest, plusupdatePrimaryDomain()andclearPrimaryDomain()onEnvironmentsResource.environment:primary-domain {environment?} {--domain=} {--clear}(aliasenv:primary-domain):--domaintakes a domain ID or name from the environment's domains; one that isn't attached fails before anything is sent.--clearsends the DELETE. Passing both flags is refused.--jsonprints the sameEnvironmentshape asenvironment:get, withprimaryDomainIdandprimaryDomainfilled in.deploying-to-cloudskill's custom-domain section.Dedicated cluster and AWS role
App\Dto\EnvironmentgainsclusterId,awsRoleArnandawsTrustPolicy.UpdateEnvironmentRequestDatagainsawsRoleArn; an empty string goes out as the explicitnullthat removes the role, likestart_commandandnightwatch_token.environment:update --aws-role-arn=sets it (empty string to remove). Interactively, "AWS role ARN" is offered in the field picker only for an environment on a dedicated cluster (clusterIdset), since no other environment can assume a role; the option is still sent for any environment when passed.Left alone
The live spec no longer lists
model_gateway_key_idonUpdateEnvironmentRequestor themodelGatewayKeyrelationship onEnvironmentResource, but theincludeenum on the environment endpoints still offersmodelGatewayKeyand theModelGatewayKeyResourceschema is still there. That still reads as a partial API change, soenvironment:update --model-gateway-key-idstays as it is.Tests
tests/Feature/EnvironmentPrimaryDomainTest.phpcovers the method, URL and body for set (by name and by ID) and clear, the--jsonshape, the no-op cases, an unattached domain, both flags together, and a headless run with neither.tests/Feature/EnvironmentUpdateTest.phpcovers sending--aws-role-arn, removing it with an empty string (sent asnull), andclusterId/awsRoleArn/awsTrustPolicythroughenvironment:get --json --fields.PromptFallbackTestskipped locally), PHPStan and Pint pass.Demo
This session's GitHub access rewrites image markdown, so each GIF below is a plain link. Add a
!before each[cloud ...]line to make it play inline.cloud environment:primary-domain
environment:primary-domainwith no arguments: the environment resolves, then a new select picks the primary domain from its root domains (or None to clear).cloud environment:update
environment:updateon an environment on a dedicated cluster: the new "AWS role ARN" option in the field picker, then its text prompt.https://claude.ai/code/session_01T1Sq4Yc6BQ4S3vcDD6eqZ6
Generated by Claude Code