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>
-OrganizationCustomRuleMetadata_Description <String>
-OrganizationManagedRuleMetadata_Description <String>
-ExcludedAccount <String[]>
-OrganizationCustomRuleMetadata_InputParameter <String>
-OrganizationManagedRuleMetadata_InputParameter <String>
-OrganizationCustomRuleMetadata_LambdaFunctionArn <String>
-OrganizationCustomRuleMetadata_MaximumExecutionFrequency <MaximumExecutionFrequency>
-OrganizationManagedRuleMetadata_MaximumExecutionFrequency <MaximumExecutionFrequency>
-OrganizationCustomRuleMetadata_OrganizationConfigRuleTriggerType <String[]>
-OrganizationCustomRuleMetadata_ResourceIdScope <String>
-OrganizationManagedRuleMetadata_ResourceIdScope <String>
-OrganizationCustomRuleMetadata_ResourceTypesScope <String[]>
-OrganizationManagedRuleMetadata_ResourceTypesScope <String[]>
-OrganizationManagedRuleMetadata_RuleIdentifier <String>
-OrganizationCustomRuleMetadata_TagKeyScope <String>
-OrganizationManagedRuleMetadata_TagKeyScope <String>
-OrganizationCustomRuleMetadata_TagValueScope <String>
-OrganizationManagedRuleMetadata_TagValueScope <String>
-Select <String>
-PassThru <SwitchParameter>
-Force <SwitchParameter>

Description

Adds or updates organization config rule for your entire organization evaluating whether your AWS resources comply with your desired configurations. Only a master account can create or update an organization config rule. This API enables organization service access through the EnableAWSServiceAccess action and creates a service linked role AWSServiceRoleForConfigMultiAccountSetup in the master account of your organization. The service linked role is created only when the role does not exist in the master account. AWS Config verifies the existence of role with GetRole action. You can use this action to create both custom AWS Config rules and AWS managed Config rules. If you are adding a new custom AWS Config rule, you must first create AWS Lambda function in the master account that the rule invokes to evaluate your resources. When you use the PutOrganizationConfigRule action to add the rule to AWS Config, you must specify the Amazon Resource Name (ARN) that AWS Lambda assigns to the function. If you are adding an AWS managed Config rule, specify the rule's identifier for the RuleIdentifier key. The maximum number of organization config rules that AWS Config supports is 150. Specify either OrganizationCustomRuleMetadata or OrganizationManagedRuleMetadata.

Parameters

-ExcludedAccount <String[]>
A comma-separated list of accounts that you want to exclude from an organization config rule.
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)
-OrganizationCustomRuleMetadata_Description <String>
The description that you provide for organization config rule.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OrganizationCustomRuleMetadata_InputParameter <String>
A string, in JSON format, that is passed to 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 AWS Config runs evaluations for a rule. Your custom rule is triggered when AWS 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 AWS Config to run an evaluation for a rule. You can specify the following notification types:
  • ConfigurationItemChangeNotification - Triggers an evaluation when AWS Config delivers a configuration item as a result of a resource change.
  • OversizedConfigurationItemChangeNotification - Triggers an evaluation when AWS Config delivers an oversized configuration item. AWS 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.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesOrganizationCustomRuleMetadata_OrganizationConfigRuleTriggerTypes
-OrganizationCustomRuleMetadata_ResourceIdScope <String>
The ID of the AWS resource that was evaluated.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OrganizationCustomRuleMetadata_ResourceTypesScope <String[]>
The type of the AWS resource that was evaluated.
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 organization config rule.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OrganizationManagedRuleMetadata_InputParameter <String>
A string, in JSON format, that is passed to organization config rule Lambda function.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesOrganizationManagedRuleMetadata_InputParameters
-OrganizationManagedRuleMetadata_MaximumExecutionFrequency <MaximumExecutionFrequency>
The maximum frequency with which AWS Config runs evaluations for a rule. You are using an AWS 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 AWS resource that was evaluated.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OrganizationManagedRuleMetadata_ResourceTypesScope <String[]>
The type of the AWS resource that was evaluated.
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 AWS Managed Config 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)
-PassThru <SwitchParameter>
Changes the cmdlet behavior to return the value passed to the OrganizationConfigRuleName parameter. The -PassThru parameter is deprecated, use -Select '^OrganizationConfigRuleName' instead. This parameter will be removed in a future version.
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 also be referenced from properties attached to the cmdlet entry in the $AWSHistory stack.

Supported Version

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