

버전 5(V5) AWS Tools for PowerShell 가 릴리스되었습니다.

변경 사항 해제 및 애플리케이션 마이그레이션에 대한 자세한 내용은 [마이그레이션 주제를](https://docs.aws.amazon.com/powershell/v5/userguide/migrating-v5.html) 참조하세요.

 [https://docs.aws.amazon.com/powershell/v5/userguide/migrating-v5.html](https://docs.aws.amazon.com/powershell/v5/userguide/migrating-v5.html)

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# AWS Config Tools for PowerShell V5를 사용한 예제
<a name="powershell_config-service_code_examples"></a>

다음 코드 예제에서는와 함께 AWS Tools for PowerShell V5를 사용하여 작업을 수행하고 일반적인 시나리오를 구현하는 방법을 보여줍니다 AWS Config.

*작업*은 대규모 프로그램에서 발췌한 코드이며 컨텍스트에 맞춰 실행해야 합니다. 작업은 개별 서비스 함수를 직접적으로 호출하는 방법을 보여주며 관련 시나리오의 컨텍스트에 맞는 작업을 볼 수 있습니다.

각 예시에는 전체 소스 코드에 대한 링크가 포함되어 있으며, 여기에서 컨텍스트에 맞춰 코드를 설정하고 실행하는 방법에 대한 지침을 찾을 수 있습니다.

**Topics**
+ [작업](#actions)

## 작업
<a name="actions"></a>

### `Add-CFGResourceTag`
<a name="config-service_TagResource_powershell_topic"></a>

다음 코드 예시는 `Add-CFGResourceTag`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 태그를 리소스 ARN, 이 경우 config-rule/config-rule-16iyn0에 연결합니다. **   

```
Add-CFGResourceTag -ResourceArn arn:aws:config:eu-west-1:123456789012:config-rule/config-rule-16iyn0 -Tag @{Key="Release";Value="Beta"}
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [TagResource](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-CFGAggregateComplianceByConfigRuleList`
<a name="config-service_DescribeAggregateComplianceByConfigRules_powershell_topic"></a>

다음 코드 예시는 `Get-CFGAggregateComplianceByConfigRuleList`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 구성 규칙에 대한 ConfigurationAggregator 'kaju' 필터링에서 세부 정보를 가져오고 규칙의 '규정 준수'를 확장/반환합니다.**  

```
Get-CFGAggregateComplianceByConfigRuleList -ConfigurationAggregatorName kaju -Filters_ConfigRuleName ALB_HTTP_TO_HTTPS_REDIRECTION_CHECK | Select-Object -ExpandProperty Compliance
```
**출력:**  

```
ComplianceContributorCount                            ComplianceType
--------------------------                            --------------
Amazon.ConfigService.Model.ComplianceContributorCount NON_COMPLIANT
```
**예제 2: 이 예제에서는 지정된 ConfigurationAggregator에서 세부 정보를 가져오고, 이 세부 정보를 지정된 계정과 애그리게이터에 포함된 모든 리전을 기준으로 필터링하고, 모든 규칙에 대한 규정 준수 여부를 추가로 반환합니다.**  

```
Get-CFGAggregateComplianceByConfigRuleList -ConfigurationAggregatorName kaju -Filters_AccountId 123456789012 | Select-Object ConfigRuleName, @{N="Compliance";E={$_.Compliance.ComplianceType}}
```
**출력:**  

```
ConfigRuleName                      Compliance
--------------                      ----------
ALB_HTTP_TO_HTTPS_REDIRECTION_CHECK NON_COMPLIANT
ec2-instance-no-public-ip           NON_COMPLIANT
desired-instance-type               NON_COMPLIANT
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DescribeAggregateComplianceByConfigRules](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-CFGAggregateComplianceDetailsByConfigRule`
<a name="config-service_GetAggregateComplianceDetailsByConfigRule_powershell_topic"></a>

다음 코드 예시는 `Get-CFGAggregateComplianceDetailsByConfigRule`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1:이 예제는 지정된 계정, 집계자, 리전 및 구성 규칙에 대해 'COMPLIANT' 상태인 AWS Config 규칙 'desired-instance-type'에 대해 resource-id 및 resource-type이 있는 출력을 선택하는 평가 결과를 반환합니다.**  

```
Get-CFGAggregateComplianceDetailsByConfigRule -AccountId 123456789012 -AwsRegion eu-west-1 -ComplianceType COMPLIANT -ConfigRuleName desired-instance-type -ConfigurationAggregatorName raju | Select-Object -ExpandProperty EvaluationResultIdentifier | Select-Object -ExpandProperty EvaluationResultQualifier
```
**출력:**  

```
ConfigRuleName        ResourceId          ResourceType
--------------        ----------          ------------
desired-instance-type i-0f1bf2f34c5678d12 AWS::EC2::Instance
desired-instance-type i-0fd12dd3456789123 AWS::EC2::Instance
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetAggregateComplianceDetailsByConfigRule](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-CFGAggregateConfigRuleComplianceSummary`
<a name="config-service_GetAggregateConfigRuleComplianceSummary_powershell_topic"></a>

다음 코드 예시는 `Get-CFGAggregateConfigRuleComplianceSummary`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 애그리게이터에 대한 규정 미준수 규칙 수를 반환합니다.**  

```
(Get-CFGAggregateConfigRuleComplianceSummary -ConfigurationAggregatorName raju).AggregateComplianceCounts.ComplianceSummary.NonCompliantResourceCount
```
**출력:**  

```
CapExceeded CappedCount
----------- -----------
False       5
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetAggregateConfigRuleComplianceSummary](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-CFGAggregateDiscoveredResourceCount`
<a name="config-service_GetAggregateDiscoveredResourceCounts_powershell_topic"></a>

다음 코드 예시는 `Get-CFGAggregateDiscoveredResourceCount`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 예제는 us-east-1 리전에 대해 필터링된 지정된 애그리게이터의 리소스 수를 반환합니다.**  

```
Get-CFGAggregateDiscoveredResourceCount -ConfigurationAggregatorName Master -Filters_Region us-east-1
```
**출력:**  

```
GroupByKey GroupedResourceCounts NextToken TotalDiscoveredResources
---------- --------------------- --------- ------------------------
           {}                              455
```
**예제 2: 이 예제에서는 지정된 애그리게이터의 필터링된 리전에 대해 RESOURCE\$1TYPE별로 그룹화된 리소스 수를 반환합니다.**  

```
Get-CFGAggregateDiscoveredResourceCount -ConfigurationAggregatorName Master -Filters_Region us-east-1 -GroupByKey RESOURCE_TYPE | 
			Select-Object -ExpandProperty GroupedResourceCounts
```
**출력:**  

```
GroupName                          ResourceCount
---------                          -------------
AWS::CloudFormation::Stack         12
AWS::CloudFront::Distribution      1
AWS::CloudTrail::Trail             1
AWS::DynamoDB::Table               1
AWS::EC2::EIP                      2
AWS::EC2::FlowLog                  2
AWS::EC2::InternetGateway          4
AWS::EC2::NatGateway               2
AWS::EC2::NetworkAcl               4
AWS::EC2::NetworkInterface         12
AWS::EC2::RouteTable               13
AWS::EC2::SecurityGroup            18
AWS::EC2::Subnet                   16
AWS::EC2::VPC                      4
AWS::EC2::VPCEndpoint              2
AWS::EC2::VPCPeeringConnection     1
AWS::IAM::Group                    2
AWS::IAM::Policy                   51
AWS::IAM::Role                     78
AWS::IAM::User                     7
AWS::Lambda::Function              3
AWS::RDS::DBSecurityGroup          1
AWS::S3::Bucket                    3
AWS::SSM::AssociationCompliance    107
AWS::SSM::ManagedInstanceInventory 108
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetAggregateDiscoveredResourceCounts](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-CFGAggregateDiscoveredResourceList`
<a name="config-service_ListAggregateDiscoveredResources_powershell_topic"></a>

다음 코드 예시는 `Get-CFGAggregateDiscoveredResourceList`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 '아일랜드' 애그리게이터에 집계된 지정된 리소스 유형에 대한 리소스 식별자를 반환합니다. 리소스 유형 목록은 https://docs.aws.amazon.com/sdkfornet/v4/apidocs/index.html?page=ConfigService/TConfigServiceResourceType.html&tocid=Amazon\$1ConfigService\$1ResourceType 페이지를 확인하세요.**  

```
Get-CFGAggregateDiscoveredResourceList -ConfigurationAggregatorName Ireland -ResourceType ([Amazon.ConfigService.ResourceType]::AWSAutoScalingAutoScalingGroup)
```
**출력:**  

```
ResourceId      : arn:aws:autoscaling:eu-west-1:123456789012:autoScalingGroup:12e3b4fc-1234-1234-a123-1d2ba3c45678:autoScalingGroupName/asg-1
ResourceName    : asg-1
ResourceType    : AWS::AutoScaling::AutoScalingGroup
SourceAccountId : 123456789012
SourceRegion    : eu-west-1
```
**예제 2: 이 예제에서는 us-east-1 리전으로 필터링된 지정된 애그리게이터에 대해 'default'라는 `AwsEC2SecurityGroup` 리소스 유형을 반환합니다.**  

```
Get-CFGAggregateDiscoveredResourceList -ConfigurationAggregatorName raju -ResourceType ([Amazon.ConfigService.ResourceType]::AWSEC2SecurityGroup) -Filters_Region us-east-1 -Filters_ResourceName default
```
**출력:**  

```
ResourceId      : sg-01234bd5dbfa67c89
ResourceName    : default
ResourceType    : AWS::EC2::SecurityGroup
SourceAccountId : 123456789102
SourceRegion    : us-east-1

ResourceId      : sg-0123a4ebbf56789be
ResourceName    : default
ResourceType    : AWS::EC2::SecurityGroup
SourceAccountId : 123456789102
SourceRegion    : us-east-1

ResourceId      : sg-4fc1d234
ResourceName    : default
ResourceType    : AWS::EC2::SecurityGroup
SourceAccountId : 123456789102
SourceRegion    : us-east-1
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [ListAggregateDiscoveredResources](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-CFGAggregateResourceConfig`
<a name="config-service_GetAggregateResourceconfig-service_powershell_topic"></a>

다음 코드 예시는 `Get-CFGAggregateResourceConfig`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 집계된 지정 리소스의 구성 항목을 반환하고 구성을 확장합니다.**  

```
(Get-CFGAggregateResourceConfig -ResourceIdentifier_SourceRegion us-east-1 -ResourceIdentifier_SourceAccountId 123456789012 -ResourceIdentifier_ResourceId sg-4fc1d234 -ResourceIdentifier_ResourceType ([Amazon.ConfigService.ResourceType]::AWSEC2SecurityGroup) -ConfigurationAggregatorName raju).Configuration | ConvertFrom-Json
```
**출력:**  

```
{"description":"default VPC security group","groupName":"default","ipPermissions":[{"ipProtocol":"-1","ipv6Ranges":[],"prefixListIds":[],"userIdGroupPairs":[{"groupId":"sg-4fc1d234","userId":"123456789012"}],"ipv4Ranges":[],"ipRanges":[]},{"fromPort":3389,"ipProtocol":"tcp","ipv6Ranges":[],"prefixListIds":[],"toPort":3389,"userIdGroupPairs":[],"ipv4Ranges":[{"cidrIp":"54.240.197.224/29","description":"office subnet"},{"cidrIp":"72.21.198.65/32","description":"home pc"}],"ipRanges":["54.240.197.224/29","72.21.198.65/32"]}],"ownerId":"123456789012","groupId":"sg-4fc1d234","ipPermissionsEgress":[{"ipProtocol":"-1","ipv6Ranges":[],"prefixListIds":[],"userIdGroupPairs":[],"ipv4Ranges":[{"cidrIp":"0.0.0.0/0"}],"ipRanges":["0.0.0.0/0"]}],"tags":[],"vpcId":"vpc-2d1c2e34"}
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetAggregateResourceconfig-service](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-CFGAggregateResourceConfigBatch`
<a name="config-service_BatchGetAggregateResourceconfig-service_powershell_topic"></a>

다음 코드 예시는 `Get-CFGAggregateResourceConfigBatch`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 애그리게이터에 있는 (식별된) 리소스의 현재 구성 항목을 가져옵니다.**  

```
$resIdentifier=[Amazon.ConfigService.Model.AggregateResourceIdentifier]@{
		ResourceId= "i-012e3cb4df567e8aa"
		ResourceName = "arn:aws:ec2:eu-west-1:123456789012:instance/i-012e3cb4df567e8aa"
		ResourceType = [Amazon.ConfigService.ResourceType]::AWSEC2Instance
		SourceAccountId = "123456789012"
		SourceRegion = "eu-west-1"
	}
		
	Get-CFGAggregateResourceConfigBatch -ResourceIdentifier $resIdentifier -ConfigurationAggregatorName raju
```
**출력:**  

```
BaseConfigurationItems UnprocessedResourceIdentifiers
---------------------- ------------------------------
{}                     {arn:aws:ec2:eu-west-1:123456789012:instance/i-012e3cb4df567e8aa}
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [BatchGetAggregateResourceconfig-service](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-CFGAggregationAuthorizationList`
<a name="config-service_DescribeAggregationAuthorizations_powershell_topic"></a>

다음 코드 예시는 `Get-CFGAggregationAuthorizationList`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 애그리게이터에 부여된 권한을 검색합니다.**  

```
Get-CFGAggregationAuthorizationList
```
**출력:**  

```
AggregationAuthorizationArn                                                            AuthorizedAccountId AuthorizedAwsRegion CreationTime
---------------------------                                                            ------------------- ------------------- ------------
arn:aws:config-service:eu-west-1:123456789012:aggregation-authorization/123456789012/eu-west-1 123456789012        eu-west-1           8/26/2019 12:55:27 AM
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DescribeAggregationAuthorizations](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-CFGComplianceByConfigRule`
<a name="config-service_DescribeComplianceByConfigRule_powershell_topic"></a>

다음 코드 예시는 `Get-CFGComplianceByConfigRule`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 예제는 규칙에 대한 현재 평가 결과가 없으므로 INSUFFICIENT\$1DATA를 반환하는 규칙 ebs-optimized-instance에 대한 규정 준수 세부 정보를 검색합니다.**  

```
(Get-CFGComplianceByConfigRule -ConfigRuleName ebs-optimized-instance).Compliance
```
**출력:**  

```
ComplianceContributorCount ComplianceType
-------------------------- --------------
                           INSUFFICIENT_DATA
```
**예제 2: 이 예제는 규칙 ALB\$1HTTP\$1TO\$1HTTPS\$1REDIRECTION\$1CHECK에 대한 비준수 리소스 수를 반환합니다.**  

```
(Get-CFGComplianceByConfigRule -ConfigRuleName ALB_HTTP_TO_HTTPS_REDIRECTION_CHECK -ComplianceType NON_COMPLIANT).Compliance.ComplianceContributorCount
```
**출력:**  

```
CapExceeded CappedCount
----------- -----------
False       2
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DescribeComplianceByConfigRule](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-CFGComplianceByResource`
<a name="config-service_DescribeComplianceByResource_powershell_topic"></a>

다음 코드 예시는 `Get-CFGComplianceByResource`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 `AWS::SSM::ManagedInstanceInventory` 리소스 유형에 'COMPLIANT' 규정 준수 유형이 있는지 확인합니다.**  

```
Get-CFGComplianceByResource -ComplianceType COMPLIANT -ResourceType AWS::SSM::ManagedInstanceInventory
```
**출력:**  

```
Compliance                            ResourceId          ResourceType
----------                            ----------          ------------
Amazon.ConfigService.Model.Compliance i-0123bcf4b567890e3 AWS::SSM::ManagedInstanceInventory
Amazon.ConfigService.Model.Compliance i-0a1234f6f5d6b78f7 AWS::SSM::ManagedInstanceInventory
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DescribeComplianceByResource](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-CFGComplianceDetailsByConfigRule`
<a name="config-service_GetComplianceDetailsByConfigRule_powershell_topic"></a>

다음 코드 예시는 `Get-CFGComplianceDetailsByConfigRule`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 예제는 규칙 access-keys-rotated에 대한 평가 결과를 얻고 규정 준수 유형별로 그룹화된 출력을 반환합니다.**  

```
Get-CFGComplianceDetailsByConfigRule -ConfigRuleName access-keys-rotated | Group-Object ComplianceType
```
**출력:**  

```
Count Name                      Group
----- ----                      -----
    2 COMPLIANT                 {Amazon.ConfigService.Model.EvaluationResult, Amazon.ConfigService.Model.EvaluationResult}
    5 NON_COMPLIANT             {Amazon.ConfigService.Model.EvaluationResult, Amazon.ConfigService.Model.EvaluationResult, Amazon.ConfigService.Model.EvaluationRes...
```
**예제 2: 이 예제는 COMPLIANT 리소스에 대한 규칙 access-keys-rotated에 대한 규정 준수 세부 정보를 쿼리합니다.**  

```
Get-CFGComplianceDetailsByConfigRule -ConfigRuleName access-keys-rotated -ComplianceType COMPLIANT | ForEach-Object {$_.EvaluationResultIdentifier.EvaluationResultQualifier}
```
**출력:**  

```
ConfigRuleName      ResourceId            ResourceType
--------------      ----------            ------------
access-keys-rotated BCAB1CDJ2LITAPVEW3JAH AWS::IAM::User
access-keys-rotated BCAB1CDJ2LITL3EHREM4Q AWS::IAM::User
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetComplianceDetailsByConfigRule](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-CFGComplianceDetailsByResource`
<a name="config-service_GetComplianceDetailsByResource_powershell_topic"></a>

다음 코드 예시는 `Get-CFGComplianceDetailsByResource`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 제공된 리소스에 대한 예제 평가 결과입니다.**  

```
Get-CFGComplianceDetailsByResource -ResourceId ABCD5STJ4EFGHIVEW6JAH -ResourceType 'AWS::IAM::User'
```
**출력:**  

```
Annotation                 :
ComplianceType             : COMPLIANT
ConfigRuleInvokedTime      : 8/25/2019 11:34:56 PM
EvaluationResultIdentifier : Amazon.ConfigService.Model.EvaluationResultIdentifier
ResultRecordedTime         : 8/25/2019 11:34:56 PM
ResultToken                :
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetComplianceDetailsByResource](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-CFGComplianceSummaryByConfigRule`
<a name="config-service_GetComplianceSummaryByConfigRule_powershell_topic"></a>

다음 코드 예시는 `Get-CFGComplianceSummaryByConfigRule`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 샘플은 규정을 준수하지 않는 Config 규칙 수를 반환합니다.**  

```
Get-CFGComplianceSummaryByConfigRule -Select ComplianceSummary.NonCompliantResourceCount
```
**출력:**  

```
CapExceeded CappedCount
----------- -----------
False       9
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetComplianceSummaryByConfigRule](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-CFGComplianceSummaryByResourceType`
<a name="config-service_GetComplianceSummaryByResourceType_powershell_topic"></a>

다음 코드 예시는 `Get-CFGComplianceSummaryByResourceType`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 샘플은 규정 준수 또는 규정 미준수 리소스 수를 반환하고 출력을 json으로 변환합니다.**  

```
Get-CFGComplianceSummaryByResourceType -Select ComplianceSummariesByResourceType.ComplianceSummary | ConvertTo-Json
{
  "ComplianceSummaryTimestamp": "2019-12-14T06:14:49.778Z",
  "CompliantResourceCount": {
    "CapExceeded": false,
    "CappedCount": 2
  },
  "NonCompliantResourceCount": {
    "CapExceeded": true,
    "CappedCount": 100
  }
}
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetComplianceSummaryByResourceType](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-CFGConfigRule`
<a name="config-service_DescribeConfigRules_powershell_topic"></a>

다음 코드 예시는 `Get-CFGConfigRule`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 샘플에는 선택한 속성과 함께 계정에 대한 구성 규칙이 나열되어 있습니다.**  

```
Get-CFGConfigRule | Select-Object ConfigRuleName, ConfigRuleId, ConfigRuleArn, ConfigRuleState
```
**출력:**  

```
ConfigRuleName                                    ConfigRuleId       ConfigRuleArn                                                        ConfigRuleState
--------------                                    ------------       -------------                                                        ---------------
ALB_REDIRECTION_CHECK                             config-rule-12iyn3 arn:aws:config-service:eu-west-1:123456789012:config-rule/config-rule-12iyn3 ACTIVE
access-keys-rotated                               config-rule-aospfr arn:aws:config-service:eu-west-1:123456789012:config-rule/config-rule-aospfr ACTIVE
autoscaling-group-elb-healthcheck-required        config-rule-cn1f2x arn:aws:config-service:eu-west-1:123456789012:config-rule/config-rule-cn1f2x ACTIVE
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DescribeConfigRules](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-CFGConfigRuleEvaluationStatus`
<a name="config-service_DescribeConfigRuleEvaluationStatus_powershell_topic"></a>

다음 코드 예시는 `Get-CFGConfigRuleEvaluationStatus`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 샘플은 제공된 구성 규칙에 대한 상태 정보를 반환합니다. **   

```
Get-CFGConfigRuleEvaluationStatus -ConfigRuleName root-account-mfa-enabled, vpc-flow-logs-enabled
```
**출력:**  

```
ConfigRuleArn                : arn:aws:config:eu-west-1:123456789012:config-rule/config-rule-kvq1wk
ConfigRuleId                 : config-rule-kvq1wk
ConfigRuleName               : root-account-mfa-enabled
FirstActivatedTime           : 8/27/2019 8:05:17 AM
FirstEvaluationStarted       : True
LastErrorCode                :
LastErrorMessage             :
LastFailedEvaluationTime     : 1/1/0001 12:00:00 AM
LastFailedInvocationTime     : 1/1/0001 12:00:00 AM
LastSuccessfulEvaluationTime : 12/13/2019 8:12:03 AM
LastSuccessfulInvocationTime : 12/13/2019 8:12:03 AM

ConfigRuleArn                : arn:aws:config:eu-west-1:123456789012:config-rule/config-rule-z1s23b
ConfigRuleId                 : config-rule-z1s23b
ConfigRuleName               : vpc-flow-logs-enabled
FirstActivatedTime           : 8/14/2019 6:23:44 AM
FirstEvaluationStarted       : True
LastErrorCode                :
LastErrorMessage             :
LastFailedEvaluationTime     : 1/1/0001 12:00:00 AM
LastFailedInvocationTime     : 1/1/0001 12:00:00 AM
LastSuccessfulEvaluationTime : 12/13/2019 7:12:01 AM
LastSuccessfulInvocationTime : 12/13/2019 7:12:01 AM
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DescribeConfigRuleEvaluationStatus](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-CFGConfigurationAggregatorList`
<a name="config-service_DescribeConfigurationAggregators_powershell_topic"></a>

다음 코드 예시는 `Get-CFGConfigurationAggregatorList`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 샘플에서는 리전/계정에 대한 모든 애그리게이터를 반환합니다.**  

```
Get-CFGConfigurationAggregatorList
```
**출력:**  

```
AccountAggregationSources     : {Amazon.ConfigService.Model.AccountAggregationSource}
ConfigurationAggregatorArn    : arn:aws:config-service:eu-west-1:123456789012:config-aggregator/config-aggregator-xabca1me
ConfigurationAggregatorName   : IrelandMaster
CreationTime                  : 8/25/2019 11:42:39 PM
LastUpdatedTime               : 8/25/2019 11:42:39 PM
OrganizationAggregationSource :

AccountAggregationSources     : {}
ConfigurationAggregatorArn    : arn:aws:config-service:eu-west-1:123456789012:config-aggregator/config-aggregator-qubqabcd
ConfigurationAggregatorName   : raju
CreationTime                  : 8/11/2019 8:39:25 AM
LastUpdatedTime               : 8/11/2019 8:39:25 AM
OrganizationAggregationSource : Amazon.ConfigService.Model.OrganizationAggregationSource
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DescribeConfigurationAggregators](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-CFGConfigurationAggregatorSourcesStatus`
<a name="config-service_DescribeConfigurationAggregatorSourcesStatus_powershell_topic"></a>

다음 코드 예시는 `Get-CFGConfigurationAggregatorSourcesStatus`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 샘플에서는 지정된 애그리게이터의 소스에 대해 요청된 필드를 표시합니다.**  

```
Get-CFGConfigurationAggregatorSourcesStatus -ConfigurationAggregatorName raju | select SourceType, LastUpdateStatus, LastUpdateTime, SourceId
```
**출력:**  

```
SourceType   LastUpdateStatus LastUpdateTime        SourceId
----------   ---------------- --------------        --------
ORGANIZATION SUCCEEDED        12/31/2019 7:45:06 AM Organization
ACCOUNT      SUCCEEDED        12/31/2019 7:09:38 AM 612641234567
ACCOUNT      SUCCEEDED        12/31/2019 7:12:53 AM 933301234567
ACCOUNT      SUCCEEDED        12/31/2019 7:18:10 AM 933301234567
ACCOUNT      SUCCEEDED        12/31/2019 7:25:17 AM 933301234567
ACCOUNT      SUCCEEDED        12/31/2019 7:25:49 AM 612641234567
ACCOUNT      SUCCEEDED        12/31/2019 7:26:11 AM 612641234567
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DescribeConfigurationAggregatorSourcesStatus](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-CFGConfigurationRecorder`
<a name="config-service_DescribeConfigurationRecorders_powershell_topic"></a>

다음 코드 예시는 `Get-CFGConfigurationRecorder`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 예제는 구성 레코더의 세부 정보를 반환합니다.**  

```
Get-CFGConfigurationRecorder | Format-List
```
**출력:**  

```
Name           : default
RecordingGroup : Amazon.ConfigService.Model.RecordingGroup
RoleARN        : arn:aws:iam::123456789012:role/aws-service-role/config.amazonaws.com/AWSServiceRoleForConfig
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DescribeConfigurationRecorders](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-CFGConfigurationRecorderStatus`
<a name="config-service_DescribeConfigurationRecorderStatus_powershell_topic"></a>

다음 코드 예시는 `Get-CFGConfigurationRecorderStatus`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 샘플은 구성 레코더의 상태를 반환합니다. **   

```
Get-CFGConfigurationRecorderStatus
```
**출력:**  

```
LastErrorCode        :
LastErrorMessage     :
LastStartTime        : 10/11/2019 10:13:51 AM
LastStatus           : Success
LastStatusChangeTime : 12/31/2019 6:14:12 AM
LastStopTime         : 10/11/2019 10:13:46 AM
Name                 : default
Recording            : True
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DescribeConfigurationRecorderStatus](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-CFGConformancePack`
<a name="config-service_DescribeConformancePacks_powershell_topic"></a>

다음 코드 예시는 `Get-CFGConformancePack`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 샘플에서는 모든 적합성 팩을 나열합니다.**  

```
Get-CFGConformancePack
```
**출력:**  

```
ConformancePackArn             : arn:aws:config:eu-west-1:123456789012:conformance-pack/dono/conformance-pack-p0acq8bpz
ConformancePackId              : conformance-pack-p0acabcde
ConformancePackInputParameters : {}
ConformancePackName            : dono
CreatedBy                      :
DeliveryS3Bucket               : kt-ps-examples
DeliveryS3KeyPrefix            :
LastUpdateRequestedTime        : 12/31/2019 8:45:31 AM
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DescribeConformancePacks](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-CFGDeliveryChannel`
<a name="config-service_DescribeDeliveryChannels_powershell_topic"></a>

다음 코드 예시는 `Get-CFGDeliveryChannel`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 예제는 리전의 전송 채널을 검색하고 세부 정보를 표시합니다.**  

```
Get-CFGDeliveryChannel -Region eu-west-1 | Select-Object Name, S3BucketName, S3KeyPrefix, @{N="DeliveryFrequency";E={$_.ConfigSnapshotDeliveryProperties.DeliveryFrequency}}
```
**출력:**  

```
Name    S3BucketName               S3KeyPrefix DeliveryFrequency
----    ------------               ----------- -----------------
default config-bucket-NA my          TwentyFour_Hours
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DescribeDeliveryChannels](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-CFGResourceTag`
<a name="config-service_ListTagsForResource_powershell_topic"></a>

다음 코드 예시는 `Get-CFGResourceTag`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 리소스에 연결된 태그를 나열합니다.**  

```
Get-CFGResourceTag -ResourceArn $rules[0].ConfigRuleArn
```
**출력:**  

```
Key     Value
---     -----
Version 1.3
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [ListTagsForResource](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Remove-CFGConformancePack`
<a name="config-service_DeleteConformancePack_powershell_topic"></a>

다음 코드 예시는 `Remove-CFGConformancePack`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 샘플에서는 팩에 대한 모든 규칙, 문제 해결 작업, 평가 결과와 함께 지정된 적합성 팩을 제거합니다.**  

```
Remove-CFGConformancePack -ConformancePackName dono
```
**출력:**  

```
Confirm
Are you sure you want to perform this action?
Performing the operation "Remove-CFGConformancePack (DeleteConformancePack)" on target "dono".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): Y
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DeleteConformancePack](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Write-CFGConformancePack`
<a name="config-service_PutConformancePack_powershell_topic"></a>

다음 코드 예시는 `Write-CFGConformancePack`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 샘플에서는 적합성 팩을 만들어 지정된 yaml 파일에서 템플릿을 가져옵니다. **   

```
Write-CFGConformancePack -ConformancePackName dono -DeliveryS3Bucket amzn-s3-demo-bucket -TemplateBody (Get-Content C:\windows\temp\template.yaml -Raw)
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [PutConformancePack](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Write-CFGDeliveryChannel`
<a name="config-service_PutDeliveryChannel_powershell_topic"></a>

다음 코드 예시는 `Write-CFGDeliveryChannel`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 예제는 기존 전송 채널의 deliveryFrequency 속성을 변경합니다.**  

```
Write-CFGDeliveryChannel -ConfigSnapshotDeliveryProperties_DeliveryFrequency TwentyFour_Hours -DeliveryChannelName default -DeliveryChannel_S3BucketName amzn-s3-demo-bucket -DeliveryChannel_S3KeyPrefix my
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [PutDeliveryChannel](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.