Posts

Showing posts with the label aws-api-gateway

How to attach vpc link to get method in api gateway via cloudformation

How to attach vpc link to get method in api gateway via cloudformation I am trying to create a api gateway via cloudformation which use a vpc link to an internal beanstalk network load balancer: Here is my code to create vpc link: VpcLink: Type: AWS::ApiGateway::VpcLink Properties: Description: vpc link Name: channel-vpc-link TargetArns: - !ImportValue channel-dns-arn and here is my api gtw code: GetMethod: Type: AWS::ApiGateway::Method DependsOn: VpcLink Properties: AuthorizationType: NONE HttpMethod: GET #RequestParameters: # method.request.path.proxy: true Integration: Type: HTTP IntegrationHttpMethod: GET Uri: Fn::Join: - '' - - "http://" - ${stageVariables.channelUrl} - "/channels" - "/stories" IntegrationResponses: - StatusCode: 200 ResponseParameters: method.response.header.Access-Control-Allow-Origin: "'*'...

Cloud9 does not expose bash_profile exports in nodejs lambda

Cloud9 does not expose bash_profile exports in nodejs lambda I have a Cloud9 environment spun up and have modified my ~/.bash_profile to export a value at the end of the file. export foo="hello world" export foo="hello world" I run . ~/.bash_profile and then echo $foo and I see hello world output in the terminal. . ~/.bash_profile echo $foo hello world I then created a NodeJS Lambda with API Gateway. I run the API Gateway locally in Cloud 9 and attempt to read the environment variables console.log(process.env) console.log(process.env) I see a list of variables available to me that AWS has defined. My export is not listed there however. Since I will be using environment variables when my Lambda is deployed, I want to test it with environment variables defined in the Cloud9 environment. Is there something specific I have to do in order to get the Lambda to read my .bash_profile exports? 1 Answer 1 ...