

버전 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)

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

# Tools for PowerShell V5를 사용한 Elastic Load Balancing - 버전 1 예제
<a name="powershell_elastic-load-balancing_code_examples"></a>

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

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

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

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

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

### `Add-ELBLoadBalancerToSubnet`
<a name="elastic-load-balancing_AttachLoadBalancerToSubnets_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 로드 밸런서에 대해 구성된 서브넷 세트에 지정된 서브넷을 추가합니다. 출력에는 전체 서브넷 목록이 포함됩니다.**  

```
Add-ELBLoadBalancerToSubnet -LoadBalancerName my-load-balancer -Subnet subnet-12345678
```
**출력:**  

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

### `Add-ELBResourceTag`
<a name="elastic-load-balancing_AddTags_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 태그를 지정된 로드 밸런서에 추가합니다. 이 예제에서 사용하는 구문에는 PowerShell 버전 3 이상이 필요합니다.**  

```
Add-ELBResourceTag -LoadBalancerName my-load-balancer -Tag @{ Key="project";Value="lima" },@{ Key="department";Value="digital-media" }
```
**예제 2: PowerShell 버전 2에서 Tag 파라미터에 대해 태그를 생성하려면 New-Object를 사용해야 합니다.**  

```
$tag = New-Object Amazon.ElasticLoadBalancing.Model.Tag
$tag.Key = "project"
$tag.Value = "lima"
Add-ELBResourceTag -LoadBalancerName my-load-balancer -Tag $tag
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [AddTags](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Disable-ELBAvailabilityZoneForLoadBalancer`
<a name="elastic-load-balancing_DisableAvailabilityZonesForLoadBalancer_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 로드 밸런서에서 지정된 가용 영역을 제거합니다. 출력에는 나머지 가용 영역이 포함됩니다.**  

```
Disable-ELBAvailabilityZoneForLoadBalancer -LoadBalancerName my-load-balancer -AvailabilityZone us-west-2a
```
**출력:**  

```
us-west-2b
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DisableAvailabilityZonesForLoadBalancer](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Dismount-ELBLoadBalancerFromSubnet`
<a name="elastic-load-balancing_DetachLoadBalancerFromSubnets_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 로드 밸런서에 대해 구성된 서브넷 세트에서 지정된 서브넷을 제거합니다. 출력에는 나머지 서브넷이 포함됩니다.**  

```
Dismount-ELBLoadBalancerFromSubnet -LoadBalancerName my-load-balancer -Subnet subnet-12345678
```
**출력:**  

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

### `Edit-ELBLoadBalancerAttribute`
<a name="elastic-load-balancing_ModifyLoadBalancerAttributes_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 로드 밸런서에 대해 교차 영역 로드 밸런싱을 활성화합니다.**  

```
Edit-ELBLoadBalancerAttribute -LoadBalancerName my-load-balancer -CrossZoneLoadBalancing_Enabled $true
```
**예제 2: 이 예제에서는 지정된 로드 밸런서에 대한 연결 드레이닝을 비활성화합니다.**  

```
Edit-ELBLoadBalancerAttribute -LoadBalancerName my-load-balancer -ConnectionDraining_Enabled $false
```
**예제 3: 이 예제에서는 지정된 로드 밸런서에 대한 액세스 로깅을 활성화합니다.**  

```
Edit-ELBLoadBalancerAttribute -LoadBalancerName my-load-balancer `
>> -AccessLog_Enabled $true `
>> -AccessLog_S3BucketName amzn-s3-demo-logging-bucket `
>> -AccessLog_S3BucketPrefix my-app/prod `
>> -AccessLog_EmitInterval 60
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [ModifyLoadBalancerAttributes](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Enable-ELBAvailabilityZoneForLoadBalancer`
<a name="elastic-load-balancing_EnableAvailabilityZonesForLoadBalancer_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 로드 밸런서에 지정된 가용 영역을 추가합니다. 출력에는 가용 영역의 전체 목록이 포함됩니다.**  

```
Enable-ELBAvailabilityZoneForLoadBalancer -LoadBalancerName my-load-balancer -AvailabilityZone us-west-2a
```
**출력:**  

```
us-west-2a
us-west-2b
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [EnableAvailabilityZonesForLoadBalancer](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-ELBInstanceHealth`
<a name="elastic-load-balancing_DescribeInstanceHealth_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 로드 밸런서에 등록된 인스턴스의 상태를 설명합니다.**  

```
Get-ELBInstanceHealth -LoadBalancerName my-load-balancer
```
**출력:**  

```
Description                   InstanceId                    ReasonCode                    State
-----------                   ----------                    ----------                    -----
N/A                           i-87654321                    N/A                           InService
Instance has failed at lea... i-12345678                    Instance                      OutOfService
```
**예제 2: 이 예제에서는 지정된 로드 밸런서에 등록되어 있는 지정된 인스턴스의 상태를 설명합니다.**  

```
Get-ELBInstanceHealth -LoadBalancerName my-load-balancer -Instance i-12345678
```
**예제 3: 이 예제에서는 지정된 인스턴스의 상태에 대한 전체 설명을 표시합니다.**  

```
(Get-ELBInstanceHealth -LoadBalancerName my-load-balancer -Instance i-12345678).Description
```
**출력:**  

```
Instance has failed at least the UnhealthyThreshold number of health checks consecutively.
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DescribeInstanceHealth](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-ELBLoadBalancer`
<a name="elastic-load-balancing_DescribeLoadBalancers_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 로드 밸런서의 이름을 나열합니다.**  

```
Get-ELBLoadBalancer | format-table -property LoadBalancerName
```
**출력:**  

```
LoadBalancerName
----------------
my-load-balancer
my-other-load-balancer
my-internal-load-balancer
```
**예제 2: 이 예제에서는 지정된 로드 밸런서를 설명합니다.**  

```
Get-ELBLoadBalancer -LoadBalancerName my-load-balancer
```
**출력:**  

```
AvailabilityZones         : {us-west-2a, us-west-2b}
BackendServerDescriptions : {Amazon.ElasticLoadBalancing.Model.BackendServerDescription}
CanonicalHostedZoneName   : my-load-balancer-1234567890.us-west-2.elb.amazonaws.com
CanonicalHostedZoneNameID : Z3DZXE0EXAMPLE
CreatedTime               : 4/11/2015 12:12:45 PM
DNSName                   : my-load-balancer-1234567890.us-west-2.elb.amazonaws.com
HealthCheck               : Amazon.ElasticLoadBalancing.Model.HealthCheck
Instances                 : {i-207d9717, i-afefb49b}
ListenerDescriptions      : {Amazon.ElasticLoadBalancing.Model.ListenerDescription}
LoadBalancerName          : my-load-balancer
Policies                  : Amazon.ElasticLoadBalancing.Model.Policies
Scheme                    : internet-facing
SecurityGroups            : {sg-a61988c3}
SourceSecurityGroup       : Amazon.ElasticLoadBalancing.Model.SourceSecurityGroup
Subnets                   : {subnet-15aaab61}
VPCId                     : vpc-a01106c2
```
**예제 3:이 예제에서는 현재 AWS 리전의 모든 로드 밸런서를 설명합니다.**  

```
Get-ELBLoadBalancer
```
**예제 4: 이 예제에서는 사용 가능한 모든 AWS 리전의 모든 로드 밸런서를 설명합니다.**  

```
Get-AWSRegion | % { Get-ELBLoadBalancer -Region $_ }
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DescribeLoadBalancers](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-ELBLoadBalancerAttribute`
<a name="elastic-load-balancing_DescribeLoadBalancerAttributes_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 로드 밸런서의 속성을 설명합니다.**  

```
Get-ELBLoadBalancerAttribute -LoadBalancerName my-load-balancer
```
**출력:**  

```
AccessLog              : Amazon.ElasticLoadBalancing.Model.AccessLog
AdditionalAttributes   : {}
ConnectionDraining     : Amazon.ElasticLoadBalancing.Model.ConnectionDraining
ConnectionSettings     : Amazon.ElasticLoadBalancing.Model.ConnectionSettings
CrossZoneLoadBalancing : Amazon.ElasticLoadBalancing.Model.CrossZoneLoadBalancing
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DescribeLoadBalancerAttributes](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-ELBLoadBalancerPolicy`
<a name="elastic-load-balancing_DescribeLoadBalancerPolicies_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 로드 밸런서와 연결된 정책을 설명합니다.**  

```
Get-ELBLoadBalancerPolicy -LoadBalancerName my-load-balancer
```
**출력:**  

```
PolicyAttributeDescriptions             PolicyName                              PolicyTypeName
---------------------------             ----------                              --------------
{ProxyProtocol}                         my-ProxyProtocol-policy                 ProxyProtocolPolicyType
{CookieName}                            my-app-cookie-policy                    AppCookieStickinessPolicyType
```
**예제 2: 이 예제에서는 지정된 정책의 속성을 설명합니다.**  

```
(Get-ELBLoadBalancerPolicy -LoadBalancerName my-load-balancer -PolicyName my-ProxyProtocol-policy).PolicyAttributeDescriptions
```
**출력:**  

```
AttributeName    AttributeValue
-------------    --------------
ProxyProtocol    true
```
**예제 3: 이 예제에서는 샘플 정책을 포함하여 사전 정의된 정책을 설명합니다. 샘플 정책의 이름에는 ELBSample- 접두사가 있습니다.**  

```
Get-ELBLoadBalancerPolicy
```
**출력:**  

```
PolicyAttributeDescriptions             PolicyName                              PolicyTypeName
---------------------------             ----------                              --------------
{Protocol-SSLv2, Protocol-TLSv1, Pro... ELBSecurityPolicy-2015-05               SSLNegotiationPolicyType
{Protocol-SSLv2, Protocol-TLSv1, Pro... ELBSecurityPolicy-2015-03               SSLNegotiationPolicyType
{Protocol-SSLv2, Protocol-TLSv1, Pro... ELBSecurityPolicy-2015-02               SSLNegotiationPolicyType
{Protocol-SSLv2, Protocol-TLSv1, Pro... ELBSecurityPolicy-2014-10               SSLNegotiationPolicyType
{Protocol-SSLv2, Protocol-TLSv1, Pro... ELBSecurityPolicy-2014-01               SSLNegotiationPolicyType
{Protocol-SSLv2, Protocol-TLSv1, Pro... ELBSecurityPolicy-2011-08               SSLNegotiationPolicyType
{Protocol-SSLv2, Protocol-TLSv1, Pro... ELBSample-ELBDefaultCipherPolicy        SSLNegotiationPolicyType
{Protocol-SSLv2, Protocol-TLSv1, Pro... ELBSample-OpenSSLDefaultCipherPolicy    SSLNegotiationPolicyType
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DescribeLoadBalancerPolicies](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-ELBLoadBalancerPolicyType`
<a name="elastic-load-balancing_DescribeLoadBalancerPolicyTypes_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 Elastic Load Balancing에서 지원하는 정책 유형을 가져옵니다.**  

```
Get-ELBLoadBalancerPolicyType
```
**출력:**  

```
Description                             PolicyAttributeTypeDescriptions         PolicyTypeName
-----------                             -------------------------------         --------------
Stickiness policy with session lifet... {CookieExpirationPeriod}                LBCookieStickinessPolicyType
Policy that controls authentication ... {PublicKeyPolicyName}                   BackendServerAuthenticationPolicyType
Listener policy that defines the cip... {Protocol-SSLv2, Protocol-TLSv1, Pro... SSLNegotiationPolicyType
Policy containing a list of public k... {PublicKey}                             PublicKeyPolicyType
Stickiness policy with session lifet... {CookieName}                            AppCookieStickinessPolicyType
Policy that controls whether to incl... {ProxyProtocol}                         ProxyProtocolPolicyType
```
**예제 2: 이 예제에서는 지정된 정책 유형을 설명합니다.**  

```
Get-ELBLoadBalancerPolicyType -PolicyTypeName ProxyProtocolPolicyType
```
**출력:**  

```
Description                             PolicyAttributeTypeDescriptions         PolicyTypeName
-----------                             -------------------------------         --------------
Policy that controls whether to incl... {ProxyProtocol}                         ProxyProtocolPolicyType
```
**예제 3: 이 예제에서는 지정된 정책 유형에 대한 전체 설명을 표시합니다.**  

```
(Get-ELBLoadBalancerPolicyType -PolicyTypeName).Description
```
**출력:**  

```
Policy that controls whether to include the IP address and port of the originating request for TCP messages. 
This policy operates on TCP/SSL listeners only
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DescribeLoadBalancerPolicyTypes](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-ELBResourceTag`
<a name="elastic-load-balancing_DescribeTags_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 로드 밸런서의 태그를 나열합니다.**  

```
Get-ELBResourceTag -LoadBalancerName @("my-load-balancer","my-internal-load-balancer")
```
**출력:**  

```
LoadBalancerName             Tags
----------------             ----
my-load-balancer             {project, department}
my-internal-load-balancer    {project, department}
```
**예제 2: 이 예제에서는 지정된 로드 밸런서의 태그를 설명합니다.**  

```
(Get-ELBResourceTag -LoadBalancerName my-load-balancer).Tags
```
**출력:**  

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

### `Join-ELBSecurityGroupToLoadBalancer`
<a name="elastic-load-balancing_ApplySecurityGroupsToLoadBalancer_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 로드 밸런서에 대한 현재 보안 그룹을 지정된 보안 그룹으로 대체합니다.**  

```
Join-ELBSecurityGroupToLoadBalancer -LoadBalancerName my-load-balancer -SecurityGroup sg-87654321
```
**출력:**  

```
sg-87654321
```
**예제 2: 현재 보안 그룹을 유지하고 추가 보안 그룹을 지정하려면 기존 보안 그룹과 새 보안 그룹을 모두 지정합니다.**  

```
Join-ELBSecurityGroupToLoadBalancer -LoadBalancerName my-load-balancer -SecurityGroup @("sg-12345678", "sg-87654321")
```
**출력:**  

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

### `New-ELBAppCookieStickinessPolicy`
<a name="elastic-load-balancing_CreateAppCookieStickinessPolicy_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 애플리케이션 생성 쿠키의 스티키 세션 수명을 따르는 스티키 정책을 생성합니다.**  

```
New-ELBAppCookieStickinessPolicy -LoadBalancerName my-load-balancer -PolicyName my-app-cookie-policy -CookieName my-app-cookie
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [CreateAppCookieStickinessPolicy](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `New-ELBLBCookieStickinessPolicy`
<a name="elastic-load-balancing_CreateLbCookieStickinessPolicy_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 스티키 세션 수명이 지정된 만료 기간(초)으로 제어되는 스티키 정책을 생성합니다.**  

```
New-ELBLBCookieStickinessPolicy -LoadBalancerName my-load-balancer -PolicyName my-duration-cookie-policy -CookieExpirationPeriod 60
```
**예제 2: 이 예제에서는 스티키 세션 수명이 브라우저의 수명(사용자 에이전트)으로 제어되는 스티키 정책을 생성합니다.**  

```
New-ELBLBCookieStickinessPolicy -LoadBalancerName my-load-balancer -PolicyName my-duration-cookie-policy
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [CreateLbCookieStickinessPolicy](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `New-ELBLoadBalancer`
<a name="elastic-load-balancing_CreateLoadBalancer_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 VPC에 HTTP 리스너가 있는 로드 밸런서를 생성합니다.**  

```
$httpListener = New-Object Amazon.ElasticLoadBalancing.Model.Listener
$httpListener.Protocol = "http"
$httpListener.LoadBalancerPort = 80
$httpListener.InstanceProtocol = "http"
$httpListener.InstancePort = 80
New-ELBLoadBalancer -LoadBalancerName my-vpc-load-balancer -SecurityGroup sg-a61988c3 -Subnet subnet-15aaab61 -Listener $httpListener

my-vpc-load-balancer-1234567890.us-west-2.elb.amazonaws.com
```
**예제 2: 이 예제에서는 EC2-Classic에 HTTP 리스너가 있는 로드 밸런서를 생성합니다.**  

```
New-ELBLoadBalancer -LoadBalancerName my-classic-load-balancer -AvailabilityZone us-west-2a` -Listener $httpListener
```
**출력:**  

```
my-classic-load-balancer-123456789.us-west-2.elb.amazonaws.com
```
**예제 3: 이 예제에서는 HTTPS 리스너가 있는 로드 밸런서를 생성합니다.**  

```
$httpsListener = New-Object Amazon.ElasticLoadBalancing.Model.Listener
$httpsListener.Protocol = "https"
$httpsListener.LoadBalancerPort = 443
$httpsListener.InstanceProtocol = "http"
$httpsListener.InstancePort = 80 
$httpsListener.SSLCertificateId="arn:aws:iam::123456789012:server-certificate/my-server-cert"
New-ELBLoadBalancer -LoadBalancerName my-load-balancer -AvailabilityZone us-west-2a -Listener $httpsListener

my-load-balancer-123456789.us-west-2.elb.amazonaws.com
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [CreateLoadBalancer](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `New-ELBLoadBalancerListener`
<a name="elastic-load-balancing_CreateLoadBalancerListeners_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 HTTPS 리스너를 지정된 로드 밸런서에 추가합니다.**  

```
$httpsListener = New-Object Amazon.ElasticLoadBalancing.Model.Listener
$httpsListener.Protocol = "https"
$httpsListener.LoadBalancerPort = 443
$httpsListener.InstanceProtocol = "https"
$httpsListener.InstancePort = 443 
$httpsListener.SSLCertificateId="arn:aws:iam::123456789012:server-certificate/my-server-cert"
New-ELBLoadBalancerListener -LoadBalancerName my-load-balancer -Listener $httpsListener
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [CreateLoadBalancerListeners](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `New-ELBLoadBalancerPolicy`
<a name="elastic-load-balancing_CreateLoadBalancerPolicy_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 로드 밸런서에 대한 새 프록시 프로토콜 정책을 생성합니다.**  

```
$attribute = New-Object Amazon.ElasticLoadBalancing.Model.PolicyAttribute -Property @{
         AttributeName="ProxyProtocol"
         AttributeValue="True"
    }
New-ELBLoadBalancerPolicy -LoadBalancerName my-load-balancer -PolicyName my-ProxyProtocol-policy -PolicyTypeName ProxyProtocolPolicyType -PolicyAttribute $attribute
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [CreateLoadBalancerPolicy](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Register-ELBInstanceWithLoadBalancer`
<a name="elastic-load-balancing_RegisterInstancesWithLoadBalancer_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 EC2 인스턴스를 지정된 로드 밸런서에 등록합니다.**  

```
Register-ELBInstanceWithLoadBalancer -LoadBalancerName my-load-balancer -Instance i-12345678
```
**출력:**  

```
InstanceId
----------
i-12345678
i-87654321
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [RegisterInstancesWithLoadBalancer](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Remove-ELBInstanceFromLoadBalancer`
<a name="elastic-load-balancing_DeregisterInstancesFromLoadBalancer_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 EC2 인스턴스를 지정된 로드 밸런서에서 제거합니다. Force 파라미터를 함께 지정하지 않는 한 작업이 진행되기 전에 확인 프롬프트가 표시됩니다.**  

```
Remove-ELBInstanceFromLoadBalancer -LoadBalancerName my-load-balancer -Instance i-12345678
```
**출력:**  

```
Confirm
Are you sure you want to perform this action?
Performing operation "Remove-ELBInstanceFromLoadBalancer (DeregisterInstancesFromLoadBalancer)" on Target
"Amazon.ElasticLoadBalancing.Model.Instance".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):

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

### `Remove-ELBLoadBalancer`
<a name="elastic-load-balancing_DeleteLoadBalancer_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 로드 밸런서를 삭제합니다. Force 파라미터를 함께 지정하지 않는 한 작업이 진행되기 전에 확인 프롬프트가 표시됩니다.**  

```
Remove-ELBLoadBalancer -LoadBalancerName my-load-balancer
```
**출력:**  

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

### `Remove-ELBLoadBalancerListener`
<a name="elastic-load-balancing_DeleteLoadBalancerListeners_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 로드 밸런서의 포트 80에서 리스너를 삭제합니다. Force 파라미터를 함께 지정하지 않는 한 작업이 진행되기 전에 확인 프롬프트가 표시됩니다.**  

```
Remove-ELBLoadBalancerListener -LoadBalancerName my-load-balancer -LoadBalancerPort 80
```
**출력:**  

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

### `Remove-ELBLoadBalancerPolicy`
<a name="elastic-load-balancing_DeleteLoadBalancerPolicy_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 로드 밸런서에서 지정된 정책을 삭제합니다. Force 파라미터를 함께 지정하지 않는 한 작업이 진행되기 전에 확인 프롬프트가 표시됩니다.**  

```
Remove-ELBLoadBalancerPolicy -LoadBalancerName my-load-balancer -PolicyName my-duration-cookie-policy
```
**출력:**  

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

### `Remove-ELBResourceTag`
<a name="elastic-load-balancing_RemoveTags_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 태그를 지정된 로드 밸런서에서 제거합니다. Force 파라미터를 함께 지정하지 않는 한 작업이 진행되기 전에 확인 프롬프트가 표시됩니다. 이 예제에서 사용하는 구문에는 PowerShell 버전 3 이상이 필요합니다.**  

```
Remove-ELBResourceTag -LoadBalancerName my-load-balancer -Tag @{ Key="project" }
```
**출력:**  

```
Confirm
Are you sure you want to perform this action?
Performing the operation "Remove-ELBResourceTag (RemoveTags)" on target "Amazon.ElasticLoadBalancing.Model.TagKeyOnly".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):
```
**예제 2: PowerShell 버전 2에서 Tag 파라미터에 대해 태그를 생성하려면 New-Object를 사용해야 합니다.**  

```
$tag = New-Object Amazon.ElasticLoadBalancing.Model.TagKeyOnly
$tag.Key = "project"
Remove-ELBResourceTag -Tag $tag -Force
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [RemoveTags](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Set-ELBHealthCheck`
<a name="elastic-load-balancing_ConfigureHealthCheck_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 로드 밸런서에 대한 상태 확인 설정을 구성합니다.**  

```
Set-ELBHealthCheck -LoadBalancerName my-load-balancer `
>> -HealthCheck_HealthyThreshold 2 `
>> -HealthCheck_UnhealthyThreshold 2 `
>> -HealthCheck_Target "HTTP:80/ping" `
>> -HealthCheck_Interval 30 `
>> -HealthCheck_Timeout 3
```
**출력:**  

```
HealthyThreshold   : 2
Interval           : 30
Target             : HTTP:80/ping
Timeout            : 3
UnhealthyThreshold : 2
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [ConfigureHealthCheck](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Set-ELBLoadBalancerListenerSSLCertificate`
<a name="elastic-load-balancing_SetLoadBalancerListenerSslCertificate_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 리스너에 대한 SSL 연결을 종료하는 인증서를 대체합니다.**  

```
Set-ELBLoadBalancerListenerSSLCertificate -LoadBalancerName my-load-balancer `
>> -LoadBalancerPort 443 `
>> -SSLCertificateId "arn:aws:iam::123456789012:server-certificate/new-server-cert"
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [SetLoadBalancerListenerSslCertificate](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Set-ELBLoadBalancerPolicyForBackendServer`
<a name="elastic-load-balancing_SetLoadBalancerPoliciesForBackendServer_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 포트의 정책을 지정된 정책으로 대체합니다.**  

```
Set-ELBLoadBalancerPolicyForBackendServer -LoadBalancerName my-load-balancer -InstancePort 80 -PolicyName my-ProxyProtocol-policy
```
**예제 2: 이 예제에서는 지정된 포트와 연결된 모든 정책을 제거합니다.**  

```
Set-ELBLoadBalancerPolicyForBackendServer -LoadBalancerName my-load-balancer -InstancePort 80
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [SetLoadBalancerPoliciesForBackendServer](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Set-ELBLoadBalancerPolicyOfListener`
<a name="elastic-load-balancing_SetLoadBalancerPoliciesOfListener_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 리스너의 정책을 지정된 정책으로 대체합니다.**  

```
Set-ELBLoadBalancerPolicyOfListener -LoadBalancerName my-load-balancer -LoadBalancerPort 443 -PolicyName my-SSLNegotiation-policy
```
**예제 2: 이 예제에서는 지정된 리스너와 연결된 모든 정책을 제거합니다.**  

```
Set-ELBLoadBalancerPolicyOfListener -LoadBalancerName my-load-balancer -LoadBalancerPort 443
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [SetLoadBalancerPoliciesOfListener](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.