AWS 服务光谱
这个软件包包含了CloudFormation中可用的AWS资源的定义.
补丁
有时需要补丁 某些方面 云阵计划,因为它们并不总是 适当配置用于我们的案件。 因此,我们需要创建一个补丁.
您可以按照这些步骤创建补丁 :
- 在下面创建新补丁文件
build/patches/service-patches/my-module.ts(或如果用于 (同一个单元). - 如果您创建了新文件, 请添加到
build/patches/service-patches/index.ts。 。 。 . - 输入您想要补丁的确切属性、属性、资源等。 例如,您可以参考现有的补丁, 或以下示例:
import { forResource, fp, registerServicePatches, replaceDefinitionProperty } from './core';
import { patching } from '@aws-cdk/service-spec-importers';
const reason = patching.Reason.sourceIssue('Something in source was wrong'); // many root causes under `patching.Reason`
registerServicePatches(
forResource('AWS::Service::Construct', (lens) => {
replaceDefinitionProperty('SomeDefinition', 'SomeProperty', { type: 'integer' }, reason)(lens);
replaceDefinition(
'SomeDefinition',
{
type: 'string',
properties : {
X : {...},
Y : {...},
Z : {...},
},
},
reason,
)(lens);
addDefinitions({newDefinition: "something something"}, reason)(lens);
fp.removeFromReadOnlyProperties('AWS::Service::Construct', ['NotAReadOnlyProperty'], reason),
}),
);
如果您没有看到你的补丁修改被反射, 请双倍检查是否有已存在的 遗留补丁 可能会覆盖您的更改.