AWSTemplateFormatVersion: 2010-09-09 Description: >- Create required infra used by both frontend and backend Resources: ################################################################## ############# Bucket to store assets for FE/BE deployment ######### ################################################################## DeploymentBucket: Type: AWS::S3::Bucket Properties: BucketName: !Join ['-', [aws, !Ref 'AWS::Region', !Ref 'AWS::AccountId', !Ref 'AWS::StackName', 'deployment']] VersioningConfiguration: Status: Enabled ################################################################## ######### Bucket to keep dataset and training parameters ########## ################################################################## # Frontend will upload training data and training parameters to this bucket # Backend need to have access to retrieve data from this bucket to train model ################################################################## TrainingBucket: Type: AWS::S3::Bucket Properties: BucketName: !Join ['-', [aws, !Ref 'AWS::Region', !Ref 'AWS::AccountId', !Ref 'AWS::StackName', 'training']] VersioningConfiguration: Status: Enabled CorsConfiguration: CorsRules: - AllowedOrigins: - '*' AllowedHeaders: - '*' AllowedMethods: - GET - PUT - POST - DELETE - HEAD MaxAge: 3000 ExposedHeaders: - x-amz-server-side-encryption - x-amz-request-id - x-amz-id-2 - ETag Outputs: DeploymentBucketName: Value: !Ref DeploymentBucket TrainingBucketName: Value: !Ref TrainingBucket TrainingBucketArn: Value: !GetAtt TrainingBucket.Arn