首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >创建CloudFormation模板以创建多个粘合连接

创建CloudFormation模板以创建多个粘合连接
EN

Stack Overflow用户
提问于 2021-01-15 04:08:55
回答 1查看 663关注 0票数 0

我正在尝试使用云形成模板创建四个胶水连接。

理想情况下,模板应该创建所有四个连接,如果我想添加更多连接,我可以添加更多连接。我试过使用多种资源,但不起作用。

但是下面的代码只为最后一个连接创建连接。以下是我的代码:

代码语言:javascript
复制
AWSTemplateFormatVersion: 2010-09-09
Description: Glue Connection
Parameters:
  VpcId:
    Description: VPC-ID
    Type: 'AWS::EC2::VPC::Id'
    Default: vpc-xxxxxxxxx
  SecurityGroup:
    Description: SG-ID
    Type: 'AWS::EC2::SecurityGroup::Id'
    Default: sg-xxxxxxxxx
  SubnetRESA1:
    Type: String
    Description: Public Subnet
    Default: subnet-xxxxxxxxx
Resources:
  GC31IPP:
    Type: 'AWS::Glue::Connection'
    Properties:
      CatalogId: 'a/c_number'
      ConnectionInput:
        ConnectionProperties:
          Name: GENERIC_CONNECTION
          Type: Network
        ConnectionType: NETWORK
        Description: >-
          Adding a Generic connection with VPC, Subnet and Security Group to
          access SAP and other DBs
        Name: GENERIC_CONNECTION
        PhysicalConnectionRequirements:
          AvailabilityZone: us-east-1a
          SecurityGroupIdList:
            - sg-xxxxxxxxx
          SubnetId: subnet-xxxxxxxxx
      ConnectionInput:
        ConnectionProperties:
          Name: MySQL_CONNECTION
          Type: JDBC
          JDBC_CONNECTION_URL: "jdbc:mysql://host-url:3306/db"
          USERNAME: "user"
          PASSWORD: "pass"
        ConnectionType: JDBC
        Description: >-
          MySQL connection to POS DB
        Name: MySQL_CONNECTION
        PhysicalConnectionRequirements:
          AvailabilityZone: us-east-1a
          SecurityGroupIdList:
            - sg-xxxxxxxxx
          SubnetId: subnet-xxxxxxxxx
      ConnectionInput:
        ConnectionProperties:
          Name: SAP_ECC_CONNECTION_Pre-ProdEnv
          Type: JDBC
          JDBC_CONNECTION_URL: "jdbc:sap://host-url:31015/?instanceNumber=10&databaseName=db_name"
          USERNAME: "user"
          PASSWORD: "pass"
        ConnectionType: JDBC
        Description: >-
          SAP ECC Pre Prod connection
        Name: SAP_ECC_CONNECTION_Pre-ProdEnv
        PhysicalConnectionRequirements:
          AvailabilityZone: us-east-1a
          SecurityGroupIdList:
            - sg-xxxxxxxxx
          SubnetId: subnet-xxxxxxxxx
      ConnectionInput:
        ConnectionProperties:
          Name: SAP_QAL_CONNECTION_QAEnv
          Type: JDBC
          JDBC_CONNECTION_URL: "jdbc:sap://host-url:32015/?instanceNumber=20&databaseName=db_name"
          USERNAME: "seru"
          PASSWORD: "pass"
        ConnectionType: JDBC
        Description: >-
          SAP ECC Pre Prod connection
        Name: SAP_QAL_CONNECTION_QAEnv
        PhysicalConnectionRequirements:
          AvailabilityZone: us-east-1a
          SecurityGroupIdList:
            - sg-xxxxxxxxx
          SubnetId: subnet-xxxxxxxxx

上面的模板只创建了一个连接,即最后一个。名称:SAP_QAL_CONNECTION_QAEnv

如何在一个脚本中添加所有这些内容?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-01-15 08:52:13

这是因为单个AWS::Glue::Connection会创建一个连接。要创建四个,您需要四个AWS::Glue::Connection资源。

需要根据您的设置进行调整的说明性示例:

代码语言:javascript
复制
  GC31IPP-Connection1:
    Type: 'AWS::Glue::Connection'
    Properties:
      CatalogId: 'a/c_number'
      ConnectionInput:
        ConnectionProperties:
          Name: GENERIC_CONNECTION
          Type: Network


  GC31IPP-Connection2:
    Type: 'AWS::Glue::Connection'
    Properties:
      CatalogId: 'a/c_number'
      ConnectionInput:
        ConnectionProperties:
          Name: GENERIC_CONNECTION
          Type: Network

  GC31IPP-Connection3:
    Type: 'AWS::Glue::Connection'
    Properties:
      CatalogId: 'a/c_number'
      ConnectionInput:
        ConnectionProperties:
          Name: GENERIC_CONNECTION
          Type: Network

  GC31IPP-Connection4:
    Type: 'AWS::Glue::Connection'
    Properties:
      CatalogId: 'a/c_number'
      ConnectionInput:
        ConnectionProperties:
          Name: GENERIC_CONNECTION
          Type: Network
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65726201

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档