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 ?
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"}`'