Class CfnOrganizationConfigRule
A CloudFormation AWS::Config::OrganizationConfigRule
.
Inherited Members
Namespace: Amazon.CDK.AWS.Config
Assembly: Amazon.CDK.AWS.Config.dll
Syntax (csharp)
public class CfnOrganizationConfigRule : CfnResource, IConstruct, IDependable, IInspectable
Syntax (vb)
Public Class CfnOrganizationConfigRule
Inherits CfnResource
Implements IConstruct, IDependable, IInspectable
Remarks
Adds or updates an AWS Config rule for your entire organization to evaluate if your AWS resources comply with your desired configurations. 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.
CloudformationResource: AWS::Config::OrganizationConfigRule
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Config;
var cfnOrganizationConfigRule = new CfnOrganizationConfigRule(this, "MyCfnOrganizationConfigRule", new CfnOrganizationConfigRuleProps {
OrganizationConfigRuleName = "organizationConfigRuleName",
// the properties below are optional
ExcludedAccounts = new [] { "excludedAccounts" },
OrganizationCustomPolicyRuleMetadata = new OrganizationCustomPolicyRuleMetadataProperty {
PolicyText = "policyText",
Runtime = "runtime",
// the properties below are optional
DebugLogDeliveryAccounts = new [] { "debugLogDeliveryAccounts" },
Description = "description",
InputParameters = "inputParameters",
MaximumExecutionFrequency = "maximumExecutionFrequency",
OrganizationConfigRuleTriggerTypes = new [] { "organizationConfigRuleTriggerTypes" },
ResourceIdScope = "resourceIdScope",
ResourceTypesScope = new [] { "resourceTypesScope" },
TagKeyScope = "tagKeyScope",
TagValueScope = "tagValueScope"
},
OrganizationCustomRuleMetadata = new OrganizationCustomRuleMetadataProperty {
LambdaFunctionArn = "lambdaFunctionArn",
OrganizationConfigRuleTriggerTypes = new [] { "organizationConfigRuleTriggerTypes" },
// the properties below are optional
Description = "description",
InputParameters = "inputParameters",
MaximumExecutionFrequency = "maximumExecutionFrequency",
ResourceIdScope = "resourceIdScope",
ResourceTypesScope = new [] { "resourceTypesScope" },
TagKeyScope = "tagKeyScope",
TagValueScope = "tagValueScope"
},
OrganizationManagedRuleMetadata = new OrganizationManagedRuleMetadataProperty {
RuleIdentifier = "ruleIdentifier",
// the properties below are optional
Description = "description",
InputParameters = "inputParameters",
MaximumExecutionFrequency = "maximumExecutionFrequency",
ResourceIdScope = "resourceIdScope",
ResourceTypesScope = new [] { "resourceTypesScope" },
TagKeyScope = "tagKeyScope",
TagValueScope = "tagValueScope"
}
});
Synopsis
Constructors
CfnOrganizationConfigRule(Construct, String, ICfnOrganizationConfigRuleProps) | Create a new |
CfnOrganizationConfigRule(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnOrganizationConfigRule(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
ExcludedAccounts | A comma-separated list of accounts excluded from organization AWS Config rule. |
OrganizationConfigRuleName | The name that you assign to organization AWS Config rule. |
OrganizationCustomPolicyRuleMetadata |
|
OrganizationCustomRuleMetadata | An |
OrganizationManagedRuleMetadata | An |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnOrganizationConfigRule(Construct, String, ICfnOrganizationConfigRuleProps)
Create a new AWS::Config::OrganizationConfigRule
.
public CfnOrganizationConfigRule(Construct scope, string id, ICfnOrganizationConfigRuleProps props)
Parameters
- scope Construct
- scope in which this resource is defined.
- id System.String
- scoped id of the resource.
- props ICfnOrganizationConfigRuleProps
- resource properties.
CfnOrganizationConfigRule(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnOrganizationConfigRule(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnOrganizationConfigRule(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnOrganizationConfigRule(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
ExcludedAccounts
A comma-separated list of accounts excluded from organization AWS Config rule.
public virtual string[] ExcludedAccounts { get; set; }
Property Value
System.String[]
Remarks
OrganizationConfigRuleName
The name that you assign to organization AWS Config rule.
public virtual string OrganizationConfigRuleName { get; set; }
Property Value
System.String
Remarks
OrganizationCustomPolicyRuleMetadata
AWS::Config::OrganizationConfigRule.OrganizationCustomPolicyRuleMetadata
.
public virtual object OrganizationCustomPolicyRuleMetadata { get; set; }
Property Value
System.Object
Remarks
OrganizationCustomRuleMetadata
An OrganizationCustomRuleMetadata
object.
public virtual object OrganizationCustomRuleMetadata { get; set; }
Property Value
System.Object
Remarks
OrganizationManagedRuleMetadata
An OrganizationManagedRuleMetadata
object.
public virtual object OrganizationManagedRuleMetadata { get; set; }
Property Value
System.Object
Remarks
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
- tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>