44from localstack .utils .catalog .catalog_loader import RemoteCatalogLoader
55from localstack .utils .catalog .common import (
66 AwsRemoteCatalog ,
7+ AwsServiceCatalog ,
78 AwsServiceOperationsSupportInLatest ,
89 AwsServicesSupportInLatest ,
10+ CloudFormationResource ,
911 CloudFormationResourcesSupportAtRuntime ,
1012 CloudFormationResourcesSupportInLatest ,
13+ LocalstackEmulatorType ,
1114 LocalStackMetadata ,
1215)
1316
@@ -25,35 +28,42 @@ def get_remote_catalog(self) -> AwsRemoteCatalog:
2528 localstack = LocalStackMetadata (version = "4.7" ),
2629 services = {
2730 "athena" : {
28- "pro" : {
29- " provider" : "athena:pro" ,
30- " operations" : ["StartQueryExecution" , "GetQueryExecution" ],
31- " plans" : ["ultimate" , "enterprise" ],
32- }
31+ "pro" : AwsServiceCatalog (
32+ provider = "athena:pro" ,
33+ operations = ["StartQueryExecution" , "GetQueryExecution" ],
34+ plans = ["ultimate" , "enterprise" ],
35+ )
3336 },
3437 "s3" : {
35- "community" : {
36- " provider" : "s3:default" ,
37- " operations" : ["CreateBucket" ],
38- " plans" : ["free" , "base" , "ultimate" , "enterprise" ],
39- } ,
40- "pro" : {
41- " provider" : "s3:pro" ,
42- " operations" : ["SelectObjectContent" ],
43- " plans" : ["base" , "ultimate" , "enterprise" ],
44- } ,
38+ "community" : AwsServiceCatalog (
39+ provider = "s3:default" ,
40+ operations = ["CreateBucket" ],
41+ plans = ["free" , "base" , "ultimate" , "enterprise" ],
42+ ) ,
43+ "pro" : AwsServiceCatalog (
44+ provider = "s3:pro" ,
45+ operations = ["SelectObjectContent" ],
46+ plans = ["base" , "ultimate" , "enterprise" ],
47+ ) ,
4548 },
4649 "kms" : {
47- "community" : {
48- " provider" : "kms:default" ,
49- " operations" : ["ListKeys" ],
50- " plans" : ["free" , "base" , "ultimate" , "enterprise" ],
51- }
50+ "community" : AwsServiceCatalog (
51+ provider = "kms:default" ,
52+ operations = ["ListKeys" ],
53+ plans = ["free" , "base" , "ultimate" , "enterprise" ],
54+ )
5255 },
5356 },
5457 cloudformation_resources = {
55- "community" : {"AWS::S3::Bucket" : {"methods" : ["Create" , "Delete" ]}},
56- "pro" : {"AWS::Athena::CapacitiesReservation" : {"methods" : ["Create" , "Update" , "Delete" ]}},
58+ "community" : {
59+ "AWS::S3::Bucket" : CloudFormationResource (methods = ["Create" , "Delete" ]),
60+ "AWS::KMS::Key" : CloudFormationResource (methods = ["Create" , "Delete" ]),
61+ },
62+ "pro" : {
63+ "AWS::Athena::CapacitiesReservation" : CloudFormationResource (
64+ methods = ["Create" , "Update" , "Delete" ]
65+ ),
66+ },
5767 },
5868)
5969
@@ -129,3 +139,10 @@ def test_get_cfn_resource_status(
129139 ):
130140 result = aws_catalog .get_cloudformation_resource_status (resource_name , service_name )
131141 assert result == expected_status
142+
143+ def test_build_cfn_catalog_resources (self , aws_catalog ):
144+ community_resources = aws_catalog .cfn_resources_in_latest [LocalstackEmulatorType .COMMUNITY ]
145+ assert set (community_resources ) == {"AWS::S3::Bucket" , "AWS::KMS::Key" }
146+
147+ pro_resources = aws_catalog .cfn_resources_in_latest [LocalstackEmulatorType .PRO ]
148+ assert set (pro_resources ) == {"AWS::Athena::CapacitiesReservation" }
0 commit comments