- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我创建了一个 CloudFormation Stackset,将 AWS Config 规则部署到两个账户。现在我想创建一个部署修复的堆栈集。当我将所有代码都放在一个 CFT 中时,最底层的代码就可以工作了。但我想首先在一个脚本中部署检测规则,然后再部署修复规则。如何从不同的脚本引用 S3BucketEncryptionEnabled 资源?
---------------------Detection --------------------------------------------------------
S3BucketEncryptionEnabled:
Type: AWS::Config::ConfigRule
Properties:
Description: Checks that your Amazon S3 bucket either has S3 default encryption enabled or that the S3 bucket policy explicitly denies put-object requests without server side encryption.
Source:
Owner: AWS
SourceIdentifier: S3_BUCKET_SERVER_SIDE_ENCRYPTION_ENABLED
Scope:
ComplianceResourceTypes:
- AWS::S3::Bucket
DependsOn: ConfigRecorder
----------------------Remediation Script-----------------------------------------------
BasicRemediationConfiguration:
Type: "AWS::Config::RemediationConfiguration"
Properties:
Automatic: True
MaximumAutomaticAttempts: 5
RetryAttemptSeconds: 60
ConfigRuleName: !Ref S3BucketEncryptionEnabled
Parameters:
AutomationAssumeRole:
StaticValue:
Values: [{"Fn::GetAtt" : ["S3Role","Arn"]}]
BucketName:
ResourceValue:
Value: RESOURCE_ID
SSEAlgorithm:
StaticValue:
Values: [AES256]
TargetId: "AWS-EnableS3BucketEncryption"
TargetType: "SSM_DOCUMENT"
TargetVersion: "1"
最佳答案
通常,在您的 Detection
模板中,您会 export输出中的 S3BucketEncryptionEnabled
。
例如:
Outputs:
S3BucketEncryptionEnabled:
Value: !Ref S3BucketEncryptionEnabled
Export:
Name: MyS3BucketEncryptionEnabled
然后在您的Remediation
模板中,您将使用ImportValue导入导出的值。
例如:
BasicRemediationConfiguration:
Type: "AWS::Config::RemediationConfiguration"
Properties:
Automatic: True
MaximumAutomaticAttempts: 5
RetryAttemptSeconds: 60
ConfigRuleName: !ImportValue MyS3BucketEncryptionEnabled
# remaining properties
关于amazon-web-services - 如何导出资源名称并在不同的 Cloudformation Stackset 中使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63106422/
在企业环境中,我的 AWS 账户属于更大的 AWS 组织的一部分。有时,CloudFormation 堆栈只会显示在我的帐户中,从名称可以清楚地看出,该堆栈来自组织中其他一些公司监督帐户中存在的 St
我创建了一个 CloudFormation Stackset,将 AWS Config 规则部署到两个账户。现在我想创建一个部署修复的堆栈集。当我将所有代码都放在一个 CFT 中时,最底层的代码就可以
我有一个简单的 CloudFormation 堆栈,我想将其部署到帐户中的所有区域,这样我就不必手动进入每个区域来部署堆栈,或创建一个使用 CLI 执行此操作的脚本。 我尝试使用 StackSets
管道运行时我们看到以下错误,并且它已回滚 Partition "" is not valid for resource "arn::s3:::stackset-test-qa-infrastr-pip
Recentry CodePipeline 引入了 CloudFormation StackSet 集成 ( https://aws.amazon.com/about-aws/whats-new/20
这可能有点难以表达,但如果您需要任何说明,请随时提出任何问题。 有多种资源和基础设施由cloudformation管理。还有一组资源将由 CDK 管理。它们的权限由 cloudformation 管理
在 AWS 账户 A 中,我在 key 管理器 中创建了一个 key ,它是带有 key token 的键:值对。我想与我的 AWS 组织下的任何账户共享此 secret ,因此它具有以下资源策略:
我有 3 个堆栈集。我使用状态机部署它们。我希望状态机是幂等的,为了测试这一点,我使用相同的输入多次调用它们。 最初,所有 3 个堆栈集均已成功部署。 在第二次更新时,3 个堆栈集中的 2 个成功,但
我正在尝试使用 CloudFormation StackSets 将 lambda 函数部署到多个 AWS 账户和区域。但由于以下错误而失败 ResourceLogicalId:OfficeHours
我是一名优秀的程序员,十分优秀!