gpt4 book ai didi

amazon-web-services - 使用对流层的 ec2、s3、负载均衡器的 AWS 配置

转载 作者:行者123 更新时间:2023-12-03 07:36:31 26 4
gpt4 key购买 nike

我正在尝试为我的实例和存储桶配置 AWS::Config

但是我在对流层中没有找到任何引用,

如何创建ConfigRule

我有cloudformation中的配置模板。

AWSConfig = t.add_resource(
config.ConfigRule(
'ConfigRule',
ConfigRuleName=Client+'S3BucketRule',
Description='S3 Public Read Prohibited Bucket Rule',
InputParameters='{}',
MaximumExecutionFrequency=config.TWELVE_HOURS,
Scope=config.Scope(
ComplianceResourceId=Ref(LogBucket),
ComplianceResourceTypes=['AWS::S3::Bucket'],
),
Source=config.Source(
Owner='AWS',
SourceIdentifier='S3_BUCKET_PUBLIC_READ_PROHIBITED',
),
)
)

最佳答案

您可以在这里找到相关的资源定义:

https://github.com/cloudtools/troposphere/blob/master/troposphere/config.py#L56

请注意,一般来说,对流层会尝试对 Cloudformation 资源/参数进行 1:1 映射。因此,如果 Cloudformation 资源是 AWS::Config::ConfigRule 那么您几乎总是可以猜测相关的对流层资源导入是 from troposphere.config import ConfigRule

希望有帮助!

关于amazon-web-services - 使用对流层的 ec2、s3、负载均衡器的 AWS 配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54789188/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com