AWS Tools for Windows PowerShell
Command Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Synopsis

Calls the AWS Config PutOrganizationConfigRule API operation.

Syntax

Write-CFGOrganizationConfigRule
-OrganizationConfigRuleName <String>
-OrganizationCustomPolicyRuleMetadata_DebugLogDeliveryAccount <String[]>
-OrganizationCustomPolicyRuleMetadata_Description <String>
-OrganizationCustomRuleMetadata_Description <String>
-OrganizationManagedRuleMetadata_Description <String>
-ExcludedAccount <String[]>
-OrganizationCustomPolicyRuleMetadata_InputParameter <String>
-OrganizationCustomRuleMetadata_InputParameter <String>
-OrganizationManagedRuleMetadata_InputParameter <String>
-OrganizationCustomRuleMetadata_LambdaFunctionArn <String>
-OrganizationCustomPolicyRuleMetadata_MaximumExecutionFrequency <MaximumExecutionFrequency>
-OrganizationCustomRuleMetadata_MaximumExecutionFrequency <MaximumExecutionFrequency>
-OrganizationManagedRuleMetadata_MaximumExecutionFrequency <MaximumExecutionFrequency>
-OrganizationCustomPolicyRuleMetadata_OrganizationConfigRuleTriggerType <String[]>
-OrganizationCustomRuleMetadata_OrganizationConfigRuleTriggerType <String[]>
-OrganizationCustomPolicyRuleMetadata_PolicyRuntime <String>
-OrganizationCustomPolicyRuleMetadata_PolicyText <String>
-OrganizationCustomPolicyRuleMetadata_ResourceIdScope <String>
-OrganizationCustomRuleMetadata_ResourceIdScope <String>
-OrganizationManagedRuleMetadata_ResourceIdScope <String>
-OrganizationCustomPolicyRuleMetadata_ResourceTypesScope <String[]>
-OrganizationCustomRuleMetadata_ResourceTypesScope <String[]>
-OrganizationManagedRuleMetadata_ResourceTypesScope <String[]>
-OrganizationManagedRuleMetadata_RuleIdentifier <String>
-OrganizationCustomPolicyRuleMetadata_TagKeyScope <String>
-OrganizationCustomRuleMetadata_TagKeyScope <String>
-OrganizationManagedRuleMetadata_TagKeyScope <String>
-OrganizationCustomPolicyRuleMetadata_TagValueScope <String>
-OrganizationCustomRuleMetadata_TagValueScope <String>
-OrganizationManagedRuleMetadata_TagValueScope <String>
-Select <String>
-Force <SwitchParameter>
-ClientConfig <AmazonConfigServiceConfig>

Description

Adds or updates an Config rule for your entire organization to evaluate if your Amazon Web Services resources comply with your desired configurations. For information on how many organization Config rules you can have per account, see Service Limits in the Config Developer Guide. Only a management account and a delegated administrator can create or update an organization Config rule. When calling this API with a delegated administrator, you must ensure Organizations ListDelegatedAdministrator permissions are added. An organization can have up to 3 delegated administrators. This API 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. Config verifies the existence of role with GetRole action. To use this API with delegated administrator, register a delegated administrator by calling Amazon Web Services Organization register-delegated-administrator for config-multiaccountsetup.amazonaws.com. There are two types of rules: Config Managed Rules and Config Custom Rules. You can use PutOrganizationConfigRule to create both Config Managed Rules and Config Custom Rules. Config Managed Rules are predefined, customizable rules created by Config. For a list of managed rules, see List of Config Managed Rules. If you are adding an Config managed rule, you must specify the rule's identifier for the RuleIdentifier key. Config Custom Rules are rules that you create from scratch. There are two ways to create Config custom rules: with Lambda functions ( Lambda Developer Guide) and with Guard (Guard GitHub Repository), a policy-as-code language. Config custom rules created with Lambda are called Config Custom Lambda Rules and Config custom rules created with Guard are called Config Custom Policy Rules. If you are adding a new Config Custom Lambda rule, you first need to create an 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 Config, you must specify the Amazon Resource Name (ARN) that Lambda assigns to the function. Prerequisite: Ensure you call EnableAllFeatures API to enable all features in an organization. Make sure to specify one of either OrganizationCustomPolicyRuleMetadata for Custom Policy rules, OrganizationCustomRuleMetadata for Custom Lambda rules, or OrganizationManagedRuleMetadata for managed rules.

Parameters

Amazon.PowerShell.Cmdlets.CFG.AmazonConfigServiceClientCmdlet.ClientConfig
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-ExcludedAccount <String[]>
A comma-separated list of accounts that you want to exclude from an organization Config rule. Starting with version 4 of the SDK this property will default to null. If no data for this property is returned from the service the property will also be null. This was changed to improve performance and allow the SDK and caller to distinguish between a property not set or a property being empty to clear out a value. To retain the previous SDK behavior set the AWSConfigs.InitializeCollections static property to true.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesExcludedAccounts
This parameter overrides confirmation prompts to force the cmdlet to continue its operation. This parameter should always be used with caution.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OrganizationConfigRuleName <String>
The name that you assign to an organization Config rule.
Required?True
Position?1
Accept pipeline input?True (ByValue, ByPropertyName)
-OrganizationCustomPolicyRuleMetadata_DebugLogDeliveryAccount <String[]>
A list of accounts that you can enable debug logging for your organization Config Custom Policy rule. List is null when debug logging is enabled for all accounts. Starting with version 4 of the SDK this property will default to null. If no data for this property is returned from the service the property will also be null. This was changed to improve performance and allow the SDK and caller to distinguish between a property not set or a property being empty to clear out a value. To retain the previous SDK behavior set the AWSConfigs.InitializeCollections static property to true.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesOrganizationCustomPolicyRuleMetadata_DebugLogDeliveryAccounts
-OrganizationCustomPolicyRuleMetadata_Description <String>
The description that you provide for your organization Config Custom Policy rule.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OrganizationCustomPolicyRuleMetadata_InputParameter <String>
A string, in JSON format, that is passed to your organization Config Custom Policy rule.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesOrganizationCustomPolicyRuleMetadata_InputParameters
-OrganizationCustomPolicyRuleMetadata_MaximumExecutionFrequency <MaximumExecutionFrequency>
The maximum frequency with which Config runs evaluations for a rule. Your Config Custom Policy rule is triggered when Config delivers the configuration snapshot. For more information, see ConfigSnapshotDeliveryProperties.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OrganizationCustomPolicyRuleMetadata_OrganizationConfigRuleTriggerType <String[]>
The type of notification that initiates Config to run an evaluation for a rule. For Config Custom Policy rules, Config supports change-initiated notification types:
  • ConfigurationItemChangeNotification - Initiates an evaluation when Config delivers a configuration item as a result of a resource change.
  • OversizedConfigurationItemChangeNotification - Initiates an evaluation when Config delivers an oversized configuration item. Config may generate this notification type when a resource changes and the notification exceeds the maximum size allowed by Amazon SNS.
Starting with version 4 of the SDK this property will default to null. If no data for this property is returned from the service the property will also be null. This was changed to improve performance and allow the SDK and caller to distinguish between a property not set or a property being empty to clear out a value. To retain the previous SDK behavior set the AWSConfigs.InitializeCollections static property to true.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesOrganizationCustomPolicyRuleMetadata_OrganizationConfigRuleTriggerTypes
-OrganizationCustomPolicyRuleMetadata_PolicyRuntime <String>
The runtime system for your organization Config Custom Policy rules. Guard is a policy-as-code language that allows you to write policies that are enforced by Config Custom Policy rules. For more information about Guard, see the Guard GitHub Repository.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OrganizationCustomPolicyRuleMetadata_PolicyText <String>
The policy definition containing the logic for your organization Config Custom Policy rule.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OrganizationCustomPolicyRuleMetadata_ResourceIdScope <String>
The ID of the Amazon Web Services resource that was evaluated.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OrganizationCustomPolicyRuleMetadata_ResourceTypesScope <String[]>
The type of the Amazon Web Services resource that was evaluated. Starting with version 4 of the SDK this property will default to null. If no data for this property is returned from the service the property will also be null. This was changed to improve performance and allow the SDK and caller to distinguish between a property not set or a property being empty to clear out a value. To retain the previous SDK behavior set the AWSConfigs.InitializeCollections static property to true.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OrganizationCustomPolicyRuleMetadata_TagKeyScope <String>
One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more specific tag values.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OrganizationCustomPolicyRuleMetadata_TagValueScope <String>
The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key).
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OrganizationCustomRuleMetadata_Description <String>
The description that you provide for your organization Config rule.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OrganizationCustomRuleMetadata_InputParameter <String>
A string, in JSON format, that is passed to your organization Config rule Lambda function.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesOrganizationCustomRuleMetadata_InputParameters
-OrganizationCustomRuleMetadata_LambdaFunctionArn <String>
The lambda function ARN.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OrganizationCustomRuleMetadata_MaximumExecutionFrequency <MaximumExecutionFrequency>
The maximum frequency with which Config runs evaluations for a rule. Your custom rule is triggered when Config delivers the configuration snapshot. For more information, see ConfigSnapshotDeliveryProperties.By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify a valid value for the MaximumExecutionFrequency parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OrganizationCustomRuleMetadata_OrganizationConfigRuleTriggerType <String[]>
The type of notification that triggers Config to run an evaluation for a rule. You can specify the following notification types:
  • ConfigurationItemChangeNotification - Triggers an evaluation when Config delivers a configuration item as a result of a resource change.
  • OversizedConfigurationItemChangeNotification - Triggers an evaluation when Config delivers an oversized configuration item. Config may generate this notification type when a resource changes and the notification exceeds the maximum size allowed by Amazon SNS.
  • ScheduledNotification - Triggers a periodic evaluation at the frequency specified for MaximumExecutionFrequency.
Starting with version 4 of the SDK this property will default to null. If no data for this property is returned from the service the property will also be null. This was changed to improve performance and allow the SDK and caller to distinguish between a property not set or a property being empty to clear out a value. To retain the previous SDK behavior set the AWSConfigs.InitializeCollections static property to true.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesOrganizationCustomRuleMetadata_OrganizationConfigRuleTriggerTypes
-OrganizationCustomRuleMetadata_ResourceIdScope <String>
The ID of the Amazon Web Services resource that was evaluated.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OrganizationCustomRuleMetadata_ResourceTypesScope <String[]>
The type of the Amazon Web Services resource that was evaluated. Starting with version 4 of the SDK this property will default to null. If no data for this property is returned from the service the property will also be null. This was changed to improve performance and allow the SDK and caller to distinguish between a property not set or a property being empty to clear out a value. To retain the previous SDK behavior set the AWSConfigs.InitializeCollections static property to true.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OrganizationCustomRuleMetadata_TagKeyScope <String>
One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more specific tag values.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OrganizationCustomRuleMetadata_TagValueScope <String>
The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key).
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OrganizationManagedRuleMetadata_Description <String>
The description that you provide for your organization Config rule.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OrganizationManagedRuleMetadata_InputParameter <String>
A string, in JSON format, that is passed to your organization Config rule Lambda function.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesOrganizationManagedRuleMetadata_InputParameters
-OrganizationManagedRuleMetadata_MaximumExecutionFrequency <MaximumExecutionFrequency>
The maximum frequency with which Config runs evaluations for a rule. This is for an Config managed rule that is triggered at a periodic frequency.By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify a valid value for the MaximumExecutionFrequency parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OrganizationManagedRuleMetadata_ResourceIdScope <String>
The ID of the Amazon Web Services resource that was evaluated.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OrganizationManagedRuleMetadata_ResourceTypesScope <String[]>
The type of the Amazon Web Services resource that was evaluated. Starting with version 4 of the SDK this property will default to null. If no data for this property is returned from the service the property will also be null. This was changed to improve performance and allow the SDK and caller to distinguish between a property not set or a property being empty to clear out a value. To retain the previous SDK behavior set the AWSConfigs.InitializeCollections static property to true.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OrganizationManagedRuleMetadata_RuleIdentifier <String>
For organization config managed rules, a predefined identifier from a list. For example, IAM_PASSWORD_POLICY is a managed rule. To reference a managed rule, see Using Config managed rules.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OrganizationManagedRuleMetadata_TagKeyScope <String>
One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more specific tag values.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OrganizationManagedRuleMetadata_TagValueScope <String>
The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key).
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Select <String>
Use the -Select parameter to control the cmdlet output. The default value is 'OrganizationConfigRuleArn'. Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.ConfigService.Model.PutOrganizationConfigRuleResponse). Specifying the name of a property of type Amazon.ConfigService.Model.PutOrganizationConfigRuleResponse will result in that property being returned. Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)

Common Credential and Region Parameters

-AccessKey <String>
The AWS access key for the user account. This can be a temporary access key if the corresponding session token is supplied to the -SessionToken parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAK
-Credential <AWSCredentials>
An AWSCredentials object instance containing access and secret key information, and optionally a token for session-based credentials.
Required?False
Position?Named
Accept pipeline input?True (ByValue, ByPropertyName)
-EndpointUrl <String>
The endpoint to make the call against.Note: This parameter is primarily for internal AWS use and is not required/should not be specified for normal usage. The cmdlets normally determine which endpoint to call based on the region specified to the -Region parameter or set as default in the shell (via Set-DefaultAWSRegion). Only specify this parameter if you must direct the call to a specific custom endpoint.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-NetworkCredential <PSCredential>
Used with SAML-based authentication when ProfileName references a SAML role profile. Contains the network credentials to be supplied during authentication with the configured identity provider's endpoint. This parameter is not required if the user's default network identity can or should be used during authentication.
Required?False
Position?Named
Accept pipeline input?True (ByValue, ByPropertyName)
-ProfileLocation <String>
Used to specify the name and location of the ini-format credential file (shared with the AWS CLI and other AWS SDKs)If this optional parameter is omitted this cmdlet will search the encrypted credential file used by the AWS SDK for .NET and AWS Toolkit for Visual Studio first. If the profile is not found then the cmdlet will search in the ini-format credential file at the default location: (user's home directory)\.aws\credentials.If this parameter is specified then this cmdlet will only search the ini-format credential file at the location given.As the current folder can vary in a shell or during script execution it is advised that you use specify a fully qualified path instead of a relative path.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAWSProfilesLocation, ProfilesLocation
-ProfileName <String>
The user-defined name of an AWS credentials or SAML-based role profile containing credential information. The profile is expected to be found in the secure credential file shared with the AWS SDK for .NET and AWS Toolkit for Visual Studio. You can also specify the name of a profile stored in the .ini-format credential file used with the AWS CLI and other AWS SDKs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesStoredCredentials, AWSProfileName
-Region <Object>
The system name of an AWS region or an AWSRegion instance. This governs the endpoint that will be used when calling service operations. Note that the AWS resources referenced in a call are usually region-specific.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesRegionToCall
-SecretKey <String>
The AWS secret key for the user account. This can be a temporary secret key if the corresponding session token is supplied to the -SessionToken parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesSK, SecretAccessKey
-SessionToken <String>
The session token if the access and secret keys are temporary session-based credentials.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesST

Outputs

This cmdlet returns a System.String object. The service call response (type Amazon.ConfigService.Model.PutOrganizationConfigRuleResponse) can be returned by specifying '-Select *'.

Supported Version

AWS Tools for PowerShell: 2.x.y.z