--- AWSTemplateFormatVersion: '2010-09-09' Description: Deploy Odoo on AWS (New VPC) (owner wjiad@) Metadata: LICENSE: Apache License Version 2.0 AWS::CloudFormation::Interface: ParameterGroups: - Label: default: Network Configuration Parameters: - AvailabilityZones - VPCCIDR - PrivateSubnet1CIDR - PrivateSubnet2CIDR - PublicSubnet1CIDR - PublicSubnet2CIDR - RemoteAccessCIDR - AccessCIDR - Label: default: Amazon EC2 Configuration Parameters: - KeyPairName - WebServerInstanceType - Label: default: Amazon RDS (PostgreSQL) Configuration Parameters: - DBInstanceClass - DBName - DBMultiAZ - DBMasterUsername - DBMasterUserPassword - DBAutoMinorVersionUpgrade - DBBackupRetentionPeriod - Label: default: Amazon EKS Configuration Parameters: - EKSName - EKSNodeType - EKSNodes - SpotNodeGroup - Label: default: Amazon ElastiCache Configuration Parameters: - ElastiCacheAutomaticFailover - ElastiCacheNodeType - ElastiCacheNodes - Label: default: Odoo Configuration Parameters: - AdminPassword ParameterLabels: AccessCIDR: default: Permitted IP range AdminPassword: default: Administrator password AvailabilityZones: default: Availability Zones WebServerInstanceType: default: WebServer instance type EKSName: default: EKS cluster name EKSNodeType: default: EKS instance type EKSNodes: default: EKS nodes instance number In order to avoid unexpected costs The template is limited minSize 2 maxSize 5 You can change it after deployment if needed SpotNodeGroup: default: EKS use Spot instance DBAutoMinorVersionUpgrade: default: Automatic upgrade to new Amazon PostgreSQL minor versions DBBackupRetentionPeriod: default: DB backup retention period DBInstanceClass: default: Amazon PostgreSQL DB instance type DBMasterUserPassword: default: DB master password DBMasterUsername: default: DB master user name DBMultiAZ: default: Enable Multi-AZ deployment for DB instance DBName: default: DB name ElastiCacheAutomaticFailover: default: ElastiCache automatic failover ElastiCacheNodeType: default: ElastiCache node type ElastiCacheNodes: default: Number of ElastiCache nodes KeyPairName: default: Key pair name PrivateSubnet1CIDR: default: Private subnet 1 CIDR PrivateSubnet2CIDR: default: Private subnet 2 CIDR PublicSubnet1CIDR: default: Public subnet 1 CIDR PublicSubnet2CIDR: default: Public subnet 2 CIDR RemoteAccessCIDR: default: Allowed WebServer external access CIDR VPCCIDR: default: VPC CIDR WebServerInstanceType: default: Web server cluster node instance type Parameters: AccessCIDR: 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])(\/([0-9]|[1-2][0-9]|3[0-2]))$ ConstraintDescription: Must be a valid IP range in x.x.x.x/x notation Default: 0.0.0.0/0 Description: 'The CIDR IP range that is permitted to access odoo instances. Note: a value of 0.0.0.0/0 will allow access from ANY ip address' Type: String AdminPassword: Default: admin Description: Password of the odoo site administrator Type: String AvailabilityZones: Description: 'List of Availability Zones to use for the subnets in the VPC. Note: The logical order is preserved (2 AZs are used for this deployment)' Type: List EKSName: Default: odoo Type: String EKSNodeType: AllowedValues: - c6g.medium - c6g.large - c6g.xlarge - c6g.2xlarge - c6g.4xlarge - c6gn.medium - t4g.micro - t4g.small - t4g.large - t4g.medium Default: c6g.large Description: Amazon EC2 instance type for the eks nodes instances Type: String EKSNodes: ConstraintDescription: Must be between 2 and 5(If workshop select 2) Default: '2' Description: Number of nodes in the EKSNodes cluster MaxValue: '5' MinValue: '2' Type: Number SpotNodeGroup: AllowedValues: - true - false Default: false Description: Select true/false to setup EKS Spot instance EKSNodescluster(If workshop select false) Type: String WebServerInstanceType: AllowedValues: - c6g.medium - c6g.large - c6g.xlarge - c6gn.medium - t4g.micro - t4g.small - t4g.large - t4g.medium Default: t4g.micro Description: Amazon EC2 instance type for the WebServer instances Type: String DBAutoMinorVersionUpgrade: AllowedValues: - 'true' - 'false' Default: 'false' Description: Select true/false to setup Auto Minor Version upgrade Type: String DBBackupRetentionPeriod: Default: '7' Description: The number of days for which automatic DB snapshots are retained. Type: String DBInstanceClass: AllowedValues: - db.m6g.large - db.m6g.xlarge - db.m6g.2xlarge - db.m6g.4xlarge - db.m6g.8xlarge - db.m6g.12xlarge - db.m6g.16xlarge - db.m5.large - db.m5.xlarge - db.m5.2xlarge - db.m5.8xlarge ConstraintDescription: Must select a valid database instance type. Default: db.m6g.large Description: The name of the compute and memory capacity class of the Amazon RDS (PostgreSQL) DB instance. Type: String DBMasterUserPassword: Default: awspartner Description: The database admin account password. Must be at least 8 characters containing letters, numbers and symbols. It can be any printable ASCII character except /, double quotes, or @. MaxLength: '32' MinLength: '8' NoEcho: 'True' Type: String DBMasterUsername: AllowedPattern: '[a-zA-Z][a-zA-Z0-9]*' ConstraintDescription: Must begin with a letter and contain only alphanumeric characters. Default: odoo Description: The database admin account username MaxLength: '16' MinLength: '1' Type: String DBMultiAZ: AllowedValues: - 'true' - 'false' Default: 'true' Description: Specifies if the database instance is a multiple Availability Zone deployment. Type: String DBName: AllowedPattern: '[a-zA-Z][a-zA-Z0-9]*' ConstraintDescription: Must begin with a letter and contain only alphanumeric characters. Default: OdooDB Description: Name of Odoo Quick Start database. MaxLength: '64' MinLength: '5' Type: String ElastiCacheAutomaticFailover: AllowedValues: - 'true' - 'false' Default: 'true' Description: Select true/false to setup Automatic Failover Type: String ElastiCacheNodeType: AllowedValues: - cache.m6g.large - cache.m6g.xlarge - cache.m6g.2xlarge - cache.m6g.4xlarge - cache.r6g.large - cache.r6g.xlarge - cache.r6g.2xlarge - cache.r6g.4xlarge - cache.r6g.8xlarge - cache.m5.large - cache.m5.2xlarge ConstraintDescription: Must select a valid cache instance type. Default: cache.m6g.large Description: The name of the compute and memory capacity class of the ElastiCache instance. Type: String ElastiCacheNodes: ConstraintDescription: Must be between 2 and 5 Default: '2' Description: Number of nodes in the ElastiCache cluster MaxValue: '5' MinValue: '2' Type: Number KeyPairName: Description: Public/private key pairs allow you to securely connect to your instance after it launches Type: AWS::EC2::KeyPair::KeyName Default: '' PrivateSubnet1CIDR: 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])(\/([0-9]|[1-2][0-9]|3[0-2]))$ ConstraintDescription: Must be a valid IP range in x.x.x.x/x notation Default: 10.0.0.0/19 Description: CIDR block for private subnet 1 located in Availability Zone 1 Type: String PrivateSubnet2CIDR: 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])(\/([0-9]|[1-2][0-9]|3[0-2]))$ ConstraintDescription: Must be a valid IP range in x.x.x.x/x notation Default: 10.0.32.0/19 Description: CIDR block for private subnet 2 located in Availability Zone 2 Type: String PublicSubnet1CIDR: 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])(\/([0-9]|[1-2][0-9]|3[0-2]))$ ConstraintDescription: Must be a valid IP range in x.x.x.x/x notation Default: 10.0.128.0/20 Description: CIDR Block for the public DMZ subnet 1 located in Availability Zone 1 Type: String PublicSubnet2CIDR: 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])(\/([0-9]|[1-2][0-9]|3[0-2]))$ ConstraintDescription: Must be a valid IP range in x.x.x.x/x notation Default: 10.0.144.0/20 Description: CIDR Block for the public DMZ subnet 2 located in Availability Zone 2 Type: String RemoteAccessCIDR: 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])(\/([0-9]|[1-2][0-9]|3[0-2]))$ ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/x Default: 0.0.0.0/0 Description: Allowed CIDR block for external SSH access to the WebServers Type: String SSLCertificateId: Default: '' Description: (Optional) The ARN of the SSL certificate to use for the webserver. [optional] Type: String VPCCIDR: 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])(\/([0-9]|[1-2][0-9]|3[0-2]))$ ConstraintDescription: Must be a valid IP range in x.x.x.x/x notation Default: 10.0.0.0/16 Description: CIDR Block for the VPC Type: String Resources: VPCStack: Type: AWS::CloudFormation::Stack Properties: TemplateURL: https://awspsa-quickstart.s3.cn-northwest-1.amazonaws.com.cn/awspsa-odoo/templates/vpc.template Parameters: AvailabilityZones: !Join - ',' - !Ref AvailabilityZones KeyPairName: !Ref KeyPairName NumberOfAZs: '2' PrivateSubnet1ACIDR: !Ref PrivateSubnet1CIDR PrivateSubnet2ACIDR: !Ref PrivateSubnet2CIDR PublicSubnet1CIDR: !Ref PublicSubnet1CIDR PublicSubnet2CIDR: !Ref PublicSubnet2CIDR VPCCIDR: !Ref VPCCIDR SecurityGroupStack: DependsOn: VPCStack Type: AWS::CloudFormation::Stack Properties: TemplateURL: https://awspsa-quickstart.s3.cn-northwest-1.amazonaws.com.cn/awspsa-odoo/templates/securitygroups.template Parameters: AccessCIDR: !Ref AccessCIDR VPCID: !GetAtt VPCStack.Outputs.VPCID VPCCIDR: !GetAtt VPCStack.Outputs.VPCCIDR RDSStack: DependsOn: SecurityGroupStack Type: AWS::CloudFormation::Stack Properties: TemplateURL: https://awspsa-quickstart.s3.cn-northwest-1.amazonaws.com.cn/awspsa-odoo/templates/rdspostgresql.template Parameters: VPCID: !GetAtt VPCStack.Outputs.VPCID CustomDBSecurityGroup: !GetAtt SecurityGroupStack.Outputs.PostgreSQLRDSSecurityGroup Subnet1ID: !GetAtt VPCStack.Outputs.PrivateSubnet1AID Subnet2ID: !GetAtt VPCStack.Outputs.PrivateSubnet2AID DBAutoMinorVersionUpgrade: !Ref DBAutoMinorVersionUpgrade DBBackupRetentionPeriod: !Ref DBBackupRetentionPeriod DBInstanceClass: !Ref DBInstanceClass DBName: !Ref DBName DBMasterUsername: !Ref DBMasterUsername DBMasterUserPassword: !Ref DBMasterUserPassword DBMultiAZ: !Ref DBMultiAZ ElastiCache: DependsOn: SecurityGroupStack Type: AWS::CloudFormation::Stack Properties: TemplateURL: https://awspsa-quickstart.s3.cn-northwest-1.amazonaws.com.cn/awspsa-odoo/templates/elasticache.template Parameters: ElastiCacheSecurityGroup: !GetAtt SecurityGroupStack.Outputs.ElastiCacheSecurityGroup Subnet1ID: !GetAtt VPCStack.Outputs.PrivateSubnet1AID Subnet2ID: !GetAtt VPCStack.Outputs.PrivateSubnet2AID ElastiCacheNodes: !Ref ElastiCacheNodes ElastiCacheAutomaticFailover: !Ref ElastiCacheAutomaticFailover ElastiCacheNodeType: !Ref ElastiCacheNodeType EFSStack: DependsOn: SecurityGroupStack Type: AWS::CloudFormation::Stack Properties: TemplateURL: https://awspsa-quickstart.s3.cn-northwest-1.amazonaws.com.cn/awspsa-odoo/templates/efsstack.template Parameters: EFSSecurityGroup: !GetAtt SecurityGroupStack.Outputs.EFSSecurityGroup PublicSubnet1: !GetAtt VPCStack.Outputs.PublicSubnet1ID PublicSubnet2: !GetAtt VPCStack.Outputs.PublicSubnet2ID WebServerStack: Type: AWS::CloudFormation::Stack DependsOn: [RDSStack, ElastiCache] Properties: TemplateURL: https://awspsa-quickstart.s3.cn-northwest-1.amazonaws.com.cn/awspsa-odoo/templates/webserver.template Parameters: AdminPassword: !Ref AdminPassword KeyPair: !Ref KeyPairName WebServerSecurityGroup: !GetAtt SecurityGroupStack.Outputs.WebServerSecurityGroup WebServerInstanceType: !Ref WebServerInstanceType PublicSubnet1: !GetAtt VPCStack.Outputs.PublicSubnet1ID PublicSubnet2: !GetAtt VPCStack.Outputs.PublicSubnet2ID Subnet1ID: !GetAtt VPCStack.Outputs.PrivateSubnet1AID Subnet2ID: !GetAtt VPCStack.Outputs.PrivateSubnet2AID VPCID: !GetAtt VPCStack.Outputs.VPCID EKSName: !Ref EKSName DBMasterUserPassword: !Ref DBMasterUserPassword DBMasterUsername: !Ref DBMasterUsername DBName: !Ref DBName DBEndPointAddress: !GetAtt RDSStack.Outputs.RDSEndPointAddress ElastiCacheEndpoint: !GetAtt ElastiCache.Outputs.ElastiCacheEndpoint EKSNodeType: !Ref EKSNodeType EKSNodes: !Ref EKSNodes SpotNodeGroup: !Ref SpotNodeGroup FileSystem: !GetAtt EFSStack.Outputs.FileSystemID Outputs: OdooEndpoint: Value: !GetAtt WebServerStack.Outputs.AdminURL ...