Skip to content

Commit

Permalink
fix(sc-template): remove AwsRegion/AWSAccountId as user-facing parame…
Browse files Browse the repository at this point in the history
…ters

Both values are now resolved automatically by CloudFormation:

This ensures the provisioner's own account ID and region are used,
not hardcoded values or user-supplied inputs that could mismatch.

Removes two parameters from the form users see when provisioning.
  • Loading branch information
Dave Arnold committed Apr 21, 2026
1 parent ff2a6b5 commit f37b6c6
Showing 1 changed file with 9 additions and 26 deletions.
35 changes: 9 additions & 26 deletions service-catalog/product-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ Metadata:
- ProjectName
- ClusterName
- Environment
- AwsRegion
- Label:
default: "Account Configuration"
Parameters:
- AccountName
- AWSAccountId
- EnvironmentAbbr
- Label:
default: "VPC Configuration"
Expand Down Expand Up @@ -48,12 +46,8 @@ Metadata:
default: "Owning Team"
Environment:
default: "Environment"
AwsRegion:
default: "AWS Region"
AccountName:
default: "AWS Account Name"
AWSAccountId:
default: "AWS Account ID"
EnvironmentAbbr:
default: "Environment Abbreviation"
VpcName:
Expand Down Expand Up @@ -106,26 +100,12 @@ Parameters:
- test
- prod

AwsRegion:
Type: String
Description: Primary AWS region for this EKS cluster
Default: us-gov-west-1
AllowedValues:
- us-gov-west-1
- us-gov-east-1

AccountName:
Type: String
Description: "AWS account name (e.g., csvd-dev-ew)"
AllowedPattern: '^[a-z0-9-]+$'
ConstraintDescription: Must contain only lowercase letters, numbers, and hyphens

AWSAccountId:
Type: String
Description: "AWS Account ID (12 digits)"
AllowedPattern: '^\d{12}$'
ConstraintDescription: Must be a valid 12-digit AWS Account ID

EnvironmentAbbr:
Type: String
Description: "Environment abbreviation (e.g., dev, prod)"
Expand All @@ -134,7 +114,7 @@ Parameters:

VpcName:
Type: String
Description: "Name of the VPC for the cluster"
Description: "Name of the VPC for the cluster (e.g., csvd-dev-ew-vpc-01)"
AllowedPattern: '^[a-z0-9-]+$'
ConstraintDescription: Must contain only lowercase letters, numbers, and hyphens

Expand Down Expand Up @@ -185,25 +165,28 @@ Conditions:
Resources:
# Custom Resource that invokes the Lambda function
# NOTE: Property names use snake_case to match Pydantic model field names.
# The Lambda normalizer converts PascalCasesnake_case but mishandles
# acronyms (e.g. AWSAccountId a_w_s_account_id), so we pass snake_case
# The Lambda normalizer converts PascalCase->snake_case but mishandles
# acronyms (e.g. AWSAccountId -> a_w_s_account_id), so we pass snake_case
# directly to avoid ambiguity.
#
# aws_account_id and aws_region are resolved via !Sub from CFN
# pseudo-parameters — they are not user-facing form fields.
RepositoryCreator:
Type: Custom::GitHubRepository
Properties:
ServiceToken: !Sub "arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:eks-terragrunt-repo-gen-template-automation"
# Core repo parameters
project_name: !Ref ProjectName
owning_team: !Ref OwningTeam
# EKS-specific parameters – these trigger the EKS rendering path in the Lambda
# EKS-specific parameters
cluster_name: !If
- ClusterNameProvided
- !Ref ClusterName
- !Ref ProjectName
environment: !Ref Environment
aws_region: !Ref AwsRegion
aws_region: !Sub "${AWS::Region}"
account_name: !Ref AccountName
aws_account_id: !Ref AWSAccountId
aws_account_id: !Sub "${AWS::AccountId}"
environment_abbr: !Ref EnvironmentAbbr
vpc_name: !Ref VpcName
vpc_domain_name: !Ref VpcDomainName
Expand Down

0 comments on commit f37b6c6

Please sign in to comment.