Class CfnOrganizationConfigRule
- All Implemented Interfaces:
IInspectable,IOrganizationConfigRuleRef,IEnvironmentAware,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
For information on how many organization AWS Config rules you can have per account, see Service Limits in the AWS Config Developer Guide .
Only a management account and a delegated administrator can create or update an organization AWS Config rule. When calling the OrganizationConfigRule resource with a delegated administrator, you must ensure AWS Organizations ListDelegatedAdministrator permissions are added. An organization can have up to 3 delegated administrators.
The OrganizationConfigRule resource enables organization service access through the EnableAWSServiceAccess action and creates a service-linked role AWSServiceRoleForConfigMultiAccountSetup in the management or delegated administrator account of your organization. The service-linked role is created only when the role does not exist in the caller account. AWS Config verifies the existence of role with GetRole action.
To use the OrganizationConfigRule resource with delegated administrator, register a delegated administrator by calling AWS Organization register-delegated-administrator for config-multiaccountsetup.amazonaws.com .
There are two types of rules: AWS Config Managed Rules and AWS Config Custom Rules . You can use PutOrganizationConfigRule to create both AWS Config Managed Rules and AWS Config Custom Rules.
AWS Config Managed Rules are predefined, customizable rules created by AWS Config . For a list of managed rules, see List of AWS Config Managed Rules . If you are adding an AWS Config managed rule, you must specify the rule's identifier for the RuleIdentifier key.
AWS Config Custom Rules are rules that you create from scratch. There are two ways to create AWS Config custom rules: with Lambda functions ( AWS Lambda Developer Guide ) and with Guard ( Guard GitHub Repository ), a policy-as-code language. AWS Config custom rules created with AWS Lambda are called AWS Config Custom Lambda Rules and AWS Config custom rules created with Guard are called AWS Config Custom Policy Rules .
If you are adding a new AWS Config Custom Lambda rule, you first need to create an AWS Lambda function in the management account or a delegated administrator that the rule invokes to evaluate your resources. You also need to create an IAM role in the managed account that can be assumed by the Lambda function. When you use PutOrganizationConfigRule to add a Custom Lambda rule to AWS Config , you must specify the Amazon Resource Name (ARN) that AWS Lambda assigns to the function.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.config.*;
CfnOrganizationConfigRule cfnOrganizationConfigRule = CfnOrganizationConfigRule.Builder.create(this, "MyCfnOrganizationConfigRule")
.organizationConfigRuleName("organizationConfigRuleName")
// the properties below are optional
.excludedAccounts(List.of("excludedAccounts"))
.organizationCustomPolicyRuleMetadata(OrganizationCustomPolicyRuleMetadataProperty.builder()
.policyText("policyText")
.runtime("runtime")
// the properties below are optional
.debugLogDeliveryAccounts(List.of("debugLogDeliveryAccounts"))
.description("description")
.inputParameters("inputParameters")
.maximumExecutionFrequency("maximumExecutionFrequency")
.organizationConfigRuleTriggerTypes(List.of("organizationConfigRuleTriggerTypes"))
.resourceIdScope("resourceIdScope")
.resourceTypesScope(List.of("resourceTypesScope"))
.tagKeyScope("tagKeyScope")
.tagValueScope("tagValueScope")
.build())
.organizationCustomRuleMetadata(OrganizationCustomRuleMetadataProperty.builder()
.lambdaFunctionArn("lambdaFunctionArn")
.organizationConfigRuleTriggerTypes(List.of("organizationConfigRuleTriggerTypes"))
// the properties below are optional
.description("description")
.inputParameters("inputParameters")
.maximumExecutionFrequency("maximumExecutionFrequency")
.resourceIdScope("resourceIdScope")
.resourceTypesScope(List.of("resourceTypesScope"))
.tagKeyScope("tagKeyScope")
.tagValueScope("tagValueScope")
.build())
.organizationManagedRuleMetadata(OrganizationManagedRuleMetadataProperty.builder()
.ruleIdentifier("ruleIdentifier")
// the properties below are optional
.description("description")
.inputParameters("inputParameters")
.maximumExecutionFrequency("maximumExecutionFrequency")
.resourceIdScope("resourceIdScope")
.resourceTypesScope(List.of("resourceTypesScope"))
.tagKeyScope("tagKeyScope")
.tagValueScope("tagValueScope")
.build())
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnOrganizationConfigRule.static interfaceAn object that specifies metadata for your organization's AWS Config Custom Policy rule.static interfaceAn object that specifies organization custom rule metadata such as resource type, resource ID of AWS resource, Lambda function ARN, and organization trigger types that trigger AWS Config to evaluate your AWS resources against a rule.static interfaceAn object that specifies organization managed rule metadata such as resource type and ID of AWS resource along with the rule identifier.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.config.IOrganizationConfigRuleRef
IOrganizationConfigRuleRef.Jsii$Default, IOrganizationConfigRuleRef.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnOrganizationConfigRule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnOrganizationConfigRule(software.amazon.jsii.JsiiObjectRef objRef) CfnOrganizationConfigRule(software.constructs.Construct scope, String id, CfnOrganizationConfigRuleProps props) Create a newAWS::Config::OrganizationConfigRule. -
Method Summary
Modifier and TypeMethodDescriptionstatic IOrganizationConfigRuleReffromOrganizationConfigRuleId(software.constructs.Construct scope, String id, String organizationConfigRuleId) Creates a new IOrganizationConfigRuleRef from a organizationConfigRuleId.A comma-separated list of accounts excluded from organization AWS Config rule.The name that you assign to organization AWS Config rule.A reference to a OrganizationConfigRule resource.An object that specifies metadata for your organization's AWS Config Custom Policy rule.AnOrganizationCustomRuleMetadataobject.AnOrganizationManagedRuleMetadataobject.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetExcludedAccounts(List<String> value) A comma-separated list of accounts excluded from organization AWS Config rule.voidThe name that you assign to organization AWS Config rule.voidAn object that specifies metadata for your organization's AWS Config Custom Policy rule.voidsetOrganizationCustomPolicyRuleMetadata(CfnOrganizationConfigRule.OrganizationCustomPolicyRuleMetadataProperty value) An object that specifies metadata for your organization's AWS Config Custom Policy rule.voidAnOrganizationCustomRuleMetadataobject.voidsetOrganizationCustomRuleMetadata(CfnOrganizationConfigRule.OrganizationCustomRuleMetadataProperty value) AnOrganizationCustomRuleMetadataobject.voidAnOrganizationManagedRuleMetadataobject.voidsetOrganizationManagedRuleMetadata(CfnOrganizationConfigRule.OrganizationManagedRuleMetadataProperty value) AnOrganizationManagedRuleMetadataobject.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnOrganizationConfigRule
protected CfnOrganizationConfigRule(software.amazon.jsii.JsiiObjectRef objRef) -
CfnOrganizationConfigRule
protected CfnOrganizationConfigRule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnOrganizationConfigRule
@Stability(Stable) public CfnOrganizationConfigRule(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnOrganizationConfigRuleProps props) Create a newAWS::Config::OrganizationConfigRule.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
fromOrganizationConfigRuleId
@Stability(Stable) @NotNull public static IOrganizationConfigRuleRef fromOrganizationConfigRuleId(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String organizationConfigRuleId) Creates a new IOrganizationConfigRuleRef from a organizationConfigRuleId.- Parameters:
scope- This parameter is required.id- This parameter is required.organizationConfigRuleId- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrId
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getOrganizationConfigRuleRef
A reference to a OrganizationConfigRule resource.- Specified by:
getOrganizationConfigRuleRefin interfaceIOrganizationConfigRuleRef
-
getOrganizationConfigRuleName
The name that you assign to organization AWS Config rule. -
setOrganizationConfigRuleName
The name that you assign to organization AWS Config rule. -
getExcludedAccounts
A comma-separated list of accounts excluded from organization AWS Config rule. -
setExcludedAccounts
A comma-separated list of accounts excluded from organization AWS Config rule. -
getOrganizationCustomPolicyRuleMetadata
An object that specifies metadata for your organization's AWS Config Custom Policy rule.Returns union: either
IResolvableorCfnOrganizationConfigRule.OrganizationCustomPolicyRuleMetadataProperty -
setOrganizationCustomPolicyRuleMetadata
An object that specifies metadata for your organization's AWS Config Custom Policy rule. -
setOrganizationCustomPolicyRuleMetadata
@Stability(Stable) public void setOrganizationCustomPolicyRuleMetadata(@Nullable CfnOrganizationConfigRule.OrganizationCustomPolicyRuleMetadataProperty value) An object that specifies metadata for your organization's AWS Config Custom Policy rule. -
getOrganizationCustomRuleMetadata
AnOrganizationCustomRuleMetadataobject.Returns union: either
IResolvableorCfnOrganizationConfigRule.OrganizationCustomRuleMetadataProperty -
setOrganizationCustomRuleMetadata
AnOrganizationCustomRuleMetadataobject. -
setOrganizationCustomRuleMetadata
@Stability(Stable) public void setOrganizationCustomRuleMetadata(@Nullable CfnOrganizationConfigRule.OrganizationCustomRuleMetadataProperty value) AnOrganizationCustomRuleMetadataobject. -
getOrganizationManagedRuleMetadata
AnOrganizationManagedRuleMetadataobject.Returns union: either
IResolvableorCfnOrganizationConfigRule.OrganizationManagedRuleMetadataProperty -
setOrganizationManagedRuleMetadata
AnOrganizationManagedRuleMetadataobject. -
setOrganizationManagedRuleMetadata
@Stability(Stable) public void setOrganizationManagedRuleMetadata(@Nullable CfnOrganizationConfigRule.OrganizationManagedRuleMetadataProperty value) AnOrganizationManagedRuleMetadataobject.
-