Cannot add environment variable through Ebextensions

0

I'm using .ebextensions to create VPCEndpoints so in the Resources section I've addded the needed section for the VPCEndpoint. Then after that in the option_settings section I'm trying to add an environment variable in my elastic beanstalk application referencing the created VPCEndpoint, but when i check the environment variables from the elastic beanstalk console the value is added as a plain text not the Ref of the VPCEndpoint (Check the screenshot) So how can i make it interpret the Ref of the endpoint ?

Enter image description here

Resources:
  NewsonarVPCEndpoint:
    Type: AWS::EC2::VPCEndpoint
    Properties:
      PrivateDnsEnabled: false
      SecurityGroupIds:
        - {"Fn::GetOptionSetting": {"Namespace": "aws:elasticbeanstalk:application:environment", "OptionName": "ALLOW_INBOUND_FROM_VPC_SECURITY_GROUP", "DefaultValue": "default_value"}}
      ServiceName: {
              "Fn::Join": [
                "", [
                  "com.amazonaws.vpce.",{"Fn::GetOptionSetting": {"Namespace": "aws:elasticbeanstalk:application:environment", "OptionName": "AWS_REGION", "DefaultValue": "us-east-1"}},".",{"Ref": "sonarVPCEndpointService"}]]
            }
      SubnetIds:
        - { "Ref": "Subnet1Id" }
        - { "Ref": "Subnet2Id" }
        - { "Ref": "Subnet3Id" }
      VpcEndpointType: Interface
      VpcId: { "Ref": "VpcId" }


option_settings:
  aws:elasticbeanstalk:application:environment:
    VPC_ENDPOINT: '`{"Ref" : "NewsonarVPCEndpoint"}`'

1개 답변
0

Hello,

If you use an AWS CloudFormation function to define an environment property, the Elastic Beanstalk console displays the value of the property before the function is evaluated. You can use the get-config platform script to confirm the values of environment properties that are available to your application. See Environment properties and other software settings.

AWS
지원 엔지니어
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠