AWSTemplateFormatVersion: "2010-09-09" Description: CUR Dashboard app stack launched into an existing VPC including ASG with timed scale-up / scale-down policy. Metadata: AWS::CloudFormation::Interface: ParameterGroups: - Label: default: "Network Configuration" Parameters: - AvailabilityZones - NumberOfAZs - VPCCIDR - PrivateSubnet1CIDR - PrivateSubnet2CIDR - PublicSubnet1CIDR - PublicSubnet2CIDR - Label: default: "Security Configuration" Parameters: - KeypairName - Label: default: "AWS Quick Start Configuration" Parameters: - QSS3BucketName - QSS3KeyPrefix - QSResourceTagPrefix - Label: default: "CUR Report Configuration" Parameters: - CURBucket - ReportName - ReportPath - CURUploadBucket - Label: default: "CUR Conversion Configuration" Parameters: - Schedule - InstanceType - SpotPrice - Label: default: "CUR Dashboard Code Configuration" Parameters: - ConfigFile - GitBranch ParameterLabels: AvailabilityZones: default: "Availability Zones" NumberOfAZs: default: "Number of Availability Zones" VPCCIDR: default: "VPC CIDR" PrivateSubnet1CIDR: default: "Private Subnet 1 CIDR" PrivateSubnet2CIDR: default: "Private Subnet 2 CIDR" PublicSubnet1CIDR: default: "Public Subnet 1 CIDR" PublicSubnet2CIDR: default: "Public Subnet 2 CIDR" KeypairName: default: "Key Pair Name" QSS3BucketName: default: "QS S3 Bucket Name" QSS3KeyPrefix: default: "QS S3 Key Prefix" QSResourceTagPrefix: default: "QS Tag Prefix" CURBucket: default: "Source CUR Bucket" CURUploadBucket: default: "Destination CUR Bucket (Leave blank if source and destination bucket should be the same)" ReportName: default: "CUR Report Name" ReportPath: default: CUR Report Path" Schedule: default: "CUR conversion schedule" InstanceType: default: "Instance Type/Size" SpotPrice: default: "Max price per hour for bid" ConfigFile: default: "Config file name" GitBranch: default: "Config git branch" Parameters: CURBucket: Type: String Description: S3 bucket configured for Cost and Usage Reports MinLength: 2 ReportName: Type: String Description: As defined under 'Report Name' within 'AWS Cost and Usage Reports' in Billing Dashboard MinLength: 2 ReportPath: Type: String Description: Ss defined under 'Report Path' within 'AWS Cost and Usage Reports' in Billing Dashboard MinLength: 2 CURUploadBucket: Type: String Default: '' Description: OPTIONAL S3 bucket for storing converted CUR files (only use this is your CUR bucket is invalid for use with Athena i.e. contains a underscore) InstanceType: Type: String Description: Instance Type to run. Larger instances required for larger CUR's Default: c4.large AllowedValues: - c4.large - c4.xlarge - c4.2xlarge - m4.large - m4.xlarge - m4.2xlarge - c5.large - c5.xlarge - c5.2xlarge SpotPrice: Type: Number Default: 0.50 MinValue: 0.01 Description: The Maximum price for the instance you want to pay (Note Actual price paid will vary based on spot market) Schedule: Type: Number Default: 4 MinValue: 1 Description: Time gap (in hours) between CUR automatic processing (the lower, the more frequent the conversion will occur) ConfigFile: Type: String Default: "analyzeCUR.config" Description: Name of cur-dashboard configuration file. This will be pushed into code-commit repo on first execution GitBranch: Type: String Default: "master" MinLength: 2 Description: Used branch for Codecommit config repo. Modify if testing changes before merge to master" KeypairName: Type: AWS::EC2::KeyPair::KeyName Description: EC2 Key[air for instances performing CUR conversion AvailabilityZones: Type: "List" Description: "List of Availability Zones to use for the subnets in the VPC. Note: The logical order is preserved. 1 or 2 AZs are used for this deployment." VPCCIDR: Type: String Description: "CIDR Block for the VPC" ConstraintDescription: "CIDR block parameter must be in the form x.x.x.x/23" AllowedPattern: "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/(23))$" Default: "10.0.0.0/23" PrivateSubnet1CIDR: Type: String Description: "CIDR block for private subnet 1 located in Availability Zone 1." ConstraintDescription: "CIDR block parameter must be in the form x.x.x.x/27" AllowedPattern: "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/(27))$" Default: "10.0.0.0/27" PrivateSubnet2CIDR: Type: String Description: "CIDR block for private subnet 1 located in Availability Zone 2." ConstraintDescription: "CIDR block parameter must be in the form x.x.x.x/27" AllowedPattern: "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/(27))$" Default: "10.0.0.32/27" PublicSubnet1CIDR: Type: String Description: "CIDR block for public subnet 1 located in Availability Zone 1." ConstraintDescription: "CIDR block parameter must be in the form x.x.x.x/27" AllowedPattern: "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/(27))$" Default: "10.0.1.0/27" PublicSubnet2CIDR: Type: String Description: "CIDR block for public subnet 1 located in Availability Zone 2." ConstraintDescription: "CIDR block parameter must be in the form x.x.x.x/27" AllowedPattern: "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/(27))$" Default: "10.0.1.32/27" QSResourceTagPrefix: Type: String Description: "Tag prefix Prefix for resources that are created as part of cur-dashboard" ConstraintDescription: "Resource tag prefix can include numbers, lowercase letters, uppercase letters, hyphens (-)." AllowedPattern: "^[0-9a-zA-Z-]*$" Default: "cur-dashboard" QSS3KeyPrefix: Type: String Description: "S3 key prefix for the Quick Start assets." ConstraintDescription: "Quick Start key prefix can include numbers, lowercase letters, uppercase letters, hyphens (-), and forward slash (/)." AllowedPattern: "^[0-9a-zA-Z-/]*$" Default: "cur-dashboard/" QSS3BucketName: Type: String Description: "S3 bucket name for the Quick Start assets." ConstraintDescription: "Quick Start bucket name can include numbers, lowercase letters, uppercase letters, and hyphens (-). It cannot start or end with a hyphen (-)." AllowedPattern: "^[0-9a-zA-Z]+([0-9a-zA-Z-]*[0-9a-zA-Z])*$" Default: "aws-quickstart" Resources: VPCStack: Type: AWS::CloudFormation::Stack Properties: TemplateURL: "Fn::Sub": "https://${QSS3BucketName}.s3.amazonaws.com/${QSS3KeyPrefix}submodules/quickstart-aws-vpc/templates/aws-vpc.template" Parameters: AvailabilityZones: "Fn::Join": - "," - Ref: AvailabilityZones PrivateSubnet1ACIDR: Ref: PrivateSubnet1CIDR PrivateSubnet2ACIDR: Ref: PrivateSubnet2CIDR PublicSubnet1CIDR: Ref: PublicSubnet1CIDR PublicSubnet2CIDR: Ref: PublicSubnet2CIDR CreatePrivateSubnets: "false" VPCCIDR: Ref: VPCCIDR KeyPairName: Ref: KeypairName CURDashboardStack: Type: AWS::CloudFormation::Stack DependsOn: VPCStack Properties: TemplateURL: Fn::Sub: https://${QSS3BucketName}.s3.amazonaws.com/${QSS3KeyPrefix}templates/CURdashboard.yaml Parameters: QSResourceTagPrefix: Ref: QSResourceTagPrefix QSS3BucketName: Ref: QSS3BucketName QSS3KeyPrefix: Ref: QSS3KeyPrefix CURBucket: Ref: CURBucket ReportName: Ref: ReportName ReportPath: Ref: ReportPath CURUploadBucket: Ref: CURUploadBucket InstanceType: Ref: InstanceType SpotPrice: Ref: SpotPrice Schedule: Ref: Schedule ConfigFile: Ref: ConfigFile GitBranch: Ref: GitBranch KeypairName: Ref: KeypairName VPCID: "Fn::GetAtt": - "VPCStack" - "Outputs.VPCID" Subnet1: "Fn::GetAtt": - "VPCStack" - "Outputs.PublicSubnet1ID" Subnet2: "Fn::GetAtt": - "VPCStack" - "Outputs.PublicSubnet2ID"