diff --git a/service-catalog/product-template.yaml b/service-catalog/product-template.yaml index c1feee4..68d6734 100644 --- a/service-catalog/product-template.yaml +++ b/service-catalog/product-template.yaml @@ -10,12 +10,10 @@ Metadata: - ProjectName - ClusterName - Environment - - AwsRegion - Label: default: "Account Configuration" Parameters: - AccountName - - AWSAccountId - EnvironmentAbbr - Label: default: "VPC Configuration" @@ -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: @@ -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)" @@ -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 @@ -185,9 +165,12 @@ 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 PascalCase→snake_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: @@ -195,15 +178,15 @@ Resources: # 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