@@ -3,7 +3,7 @@ Description: >-
33 Prerequisites for Sim from the AWS Marketplace container listing: Amazon RDS for PostgreSQL 17
44 (pgvector), Amazon ElastiCache (Valkey) with TLS and an auth token, and the IAM role the Sim
55 ServiceAccount assumes (IRSA) to check the Marketplace license in AWS License Manager and, with
6- UploadBucketPrefix , to use your S3 upload buckets. Deploy it
6+ UploadBuckets , to use your S3 upload buckets. Deploy it
77 in the region and VPC of your EKS cluster, then use its outputs in values.yaml and the two
88 Kubernetes Secrets described in the listing's usage instructions.
99
@@ -37,17 +37,19 @@ Parameters:
3737 Type : String
3838 Default : cache.m7g.large
3939 Description : ElastiCache node type.
40- UploadBucketPrefix :
41- Type : String
40+ UploadBuckets :
41+ Type : CommaDelimitedList
4242 Default : ' '
43- AllowedPattern : ' ^$|^[a-z0-9][a-z0-9.-]{0,40}$'
4443 Description : >-
45- Name prefix of the S3 buckets you create for uploads (e.g. "sim" for sim-workspace-files,
46- sim-knowledge-base, ... ). The license role is then granted read, write and multipart access
47- to <prefix>-* buckets. Empty grants no S3 access.
44+ Exact names of the S3 buckets you create for uploads, comma-separated without spaces
45+ (S3_BUCKET_NAME and every S3_*_BUCKET_NAME in values.yaml ). The license role is granted read,
46+ write and multipart access to these buckets only . Empty grants no S3 access.
4847
4948Conditions :
50- GrantUploadBuckets : !Not [!Equals [!Ref UploadBucketPrefix, '']]
49+ GrantUploadBuckets : !Not [!Equals [!Join ['', !Ref UploadBuckets], '']]
50+ # Fn::Join takes only a literal delimiter, so each partition's ARN prefix is spelled out.
51+ InChina : !Equals [!Ref AWS::Partition, aws-cn]
52+ InGovCloud : !Equals [!Ref AWS::Partition, aws-us-gov]
5153
5254Resources :
5355 DatabaseSecurityGroup :
@@ -184,7 +186,17 @@ Resources:
184186 Statement :
185187 - Effect : Allow
186188 Action : s3:ListBucket
187- Resource : !Sub 'arn:${AWS::Partition}:s3:::${UploadBucketPrefix}-*'
189+ Resource : !Split
190+ - ' ,'
191+ - !Sub
192+ - ' arn:${AWS::Partition}:s3:::${Names}'
193+ - Names : !If
194+ - InChina
195+ - !Join [',arn:aws-cn:s3:::', !Ref UploadBuckets]
196+ - !If
197+ - InGovCloud
198+ - !Join [',arn:aws-us-gov:s3:::', !Ref UploadBuckets]
199+ - !Join [',arn:aws:s3:::', !Ref UploadBuckets]
188200 # Large uploads are multipart: Sim aborts and lists the parts of its own uploads.
189201 - Effect : Allow
190202 Action :
@@ -193,7 +205,17 @@ Resources:
193205 - s3:DeleteObject
194206 - s3:AbortMultipartUpload
195207 - s3:ListMultipartUploadParts
196- Resource : !Sub 'arn:${AWS::Partition}:s3:::${UploadBucketPrefix}-*/*'
208+ Resource : !Split
209+ - ' ,'
210+ - !Sub
211+ - ' arn:${AWS::Partition}:s3:::${Names}/*'
212+ - Names : !If
213+ - InChina
214+ - !Join ['/*,arn:aws-cn:s3:::', !Ref UploadBuckets]
215+ - !If
216+ - InGovCloud
217+ - !Join ['/*,arn:aws-us-gov:s3:::', !Ref UploadBuckets]
218+ - !Join ['/*,arn:aws:s3:::', !Ref UploadBuckets]
197219 - !Ref AWS::NoValue
198220
199221Outputs :
0 commit comments