CloudFormation Tempate - Choose Other private IP addresses

0

I am writing a cloudformation template to create a network load balancer. For registered targets, I need to specify 'Other private IP address' and not an IP with the VPC. I didn't see any option to do that in the template anatomy. Can someone please assist with this issue?

質問済み 2年前1229ビュー
3回答
0
承認された回答

Hello

You can use the Example below, ip – Targets are registered as IP addresses. You can use any IPv4 address from the load balancer’s VPC CIDR for targets within load balancer’s VPC and any IPv4 address from the RFC 1918 ranges (10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16) or the RFC 6598 range (100.64.0.0/10) for targets located outside the load balancer’s VPC (this includes Peered VPC, EC2-Classic, and on-premises targets reachable over Direct Connect or VPN).

---
AWSTemplateFormatVersion: '2010-09-09'
Description: 'Target Group for the Load balancer'

# target group Load balancer
Resources:

  NetworkLoadBalancerTargetGroup:
    Type: AWS::ElasticLoadBalancingV2::TargetGroup
    Properties:
      Name: "NlbTargetGroup"
      Port: 80
      Protocol: HTTP
      VpcId: "vpc-XXXXXX"
      TargetGroupAttributes:
        - Key: deregistration_delay.timeout_seconds
          Value: 300
      TargetType: ip
      Targets: # list of the primary IP addresses of the Network interface(s) associated with the VPC endpoint
         - Id: 172.31.0.XX
           Port: 80
         - Id: 172.31.0.XX
           Port: 80
profile picture
GK
回答済み 2年前
0

Thank you!

回答済み 2年前
0

This only seems to work for usecases where the IP is in the same subnet. It errors out stating the Availability Zones for IP address must be all when not within the VPC (which is the case when we do it manually in the console)

AWS
PK
回答済み 2年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ