Resources: dataBucket: Metadata: 'aws:copilot:description': 'An Amazon S3 bucket to store and retrieve objects' Type: AWS::S3::Bucket DeletionPolicy: Retain Properties: VersioningConfiguration: Status: Enabled AccessControl: Private BucketEncryption: ServerSideEncryptionConfiguration: - ServerSideEncryptionByDefault: SSEAlgorithm: AES256 PublicAccessBlockConfiguration: BlockPublicAcls: true BlockPublicPolicy: true dataBucketPolicy: Metadata: 'aws:copilot:description': 'A bucket policy to deny unencrypted access to the bucket and its contents' Type: AWS::S3::BucketPolicy DeletionPolicy: Retain Properties: PolicyDocument: Version: 2012-10-17 Statement: - Sid: ForceHTTPS Effect: Deny Principal: '*' Action: 's3:*' Resource: - !Sub ${ dataBucket.Arn}/* - !Sub ${ dataBucket.Arn} Condition: Bool: "aws:SecureTransport": false Bucket: !Ref dataBucket Outputs: databucket: Description: "The name of a user-defined bucket." Value: !Ref dataBucket Export: Name: "algotrading-s3bucket"