コード例 #1
0
ファイル: test_s3.py プロジェクト: michael-k/awacs
 def test_non_bucket_arns(self):
     for resource in [
             "accesspoint/my-access-point",
             "job/job-id",
             "storage-lens/config-id",
     ]:
         arn = ARN(resource, "us-east-1", "111122223333")
         self.assertEqual(arn.JSONrepr(),
                          f"arn:aws:s3:us-east-1:111122223333:{resource}")
    DeletionPolicy="Retain",
))

t.add_resource(
    BucketPolicy('BucketPolicy',
                 Bucket=Ref("S3Bucket"),
                 PolicyDocument=Policy(
                     Version='2012-10-17',
                     Statement=[
                         Statement(
                             Action=[PutObject],
                             Effect=Allow,
                             Principal=Principal("AWS", ["127311923021"]),
                             Resource=[
                                 Join('', [
                                     ARN(''),
                                     Ref("S3Bucket"), "/AWSLogs/511912822958/*"
                                 ])
                             ],
                         )
                     ])))

t.add_resource(
    ec2.SecurityGroup(
        "LoadBalancerSecurityGroup",
        GroupDescription="Web load balancer security group.",
        VpcId=ImportValue(
            Join("-", [
                Select(0, Split("-", Ref("AWS::StackName"))), "cluster-vpc-id"
            ])),
        SecurityGroupIngress=[
コード例 #3
0
ファイル: test_s3.py プロジェクト: michael-k/awacs
 def test_aws(self):
     arn = ARN("bucket/key", "us-east-1", "account")
     self.assertEqual(arn.JSONrepr(), "arn:aws:s3:::bucket/key")
コード例 #4
0
ファイル: test_s3.py プロジェクト: michael-k/awacs
 def test_gov(self):
     arn = ARN("bucket/key", "us-gov-west-1", "account")
     self.assertEqual(arn.JSONrepr(), "arn:aws-us-gov:s3:::bucket/key")
コード例 #5
0
ファイル: test_s3.py プロジェクト: michael-k/awacs
 def test_cn(self):
     arn = ARN("bucket/key", "cn-north-1", "account")
     self.assertEqual(arn.JSONrepr(), "arn:aws-cn:s3:::bucket/key")