File tree Expand file tree Collapse file tree 3 files changed +11
-13
lines changed
Expand file tree Collapse file tree 3 files changed +11
-13
lines changed Original file line number Diff line number Diff line change 11const uuidv4 = require ( 'uuid/v4' ) ;
22const AWS = require ( 'aws-sdk' ) ;
33
4- const LOCALSTACK_HOSTNAME = process . env . LOCALSTACK_HOSTNAME ;
5- const ENDPOINT = `http://${ LOCALSTACK_HOSTNAME } :4566` ;
6- if ( LOCALSTACK_HOSTNAME ) {
4+ const AWS_ENDPOINT_URL = process . env . AWS_ENDPOINT_URL ;
5+ if ( AWS_ENDPOINT_URL ) {
76 process . env . AWS_SECRET_ACCESS_KEY = 'test' ;
87 process . env . AWS_ACCESS_KEY_ID = 'test' ;
98}
109
1110const DYNAMODB_TABLE = 'appRequests' ;
1211const QUEUE_NAME = 'requestQueue' ;
13- const CLIENT_CONFIG = LOCALSTACK_HOSTNAME ? { endpoint : ENDPOINT } : { } ;
12+ const CLIENT_CONFIG = AWS_ENDPOINT_URL ? { endpoint : AWS_ENDPOINT_URL } : { } ;
1413
1514const connectSQS = ( ) => new AWS . SQS ( CLIENT_CONFIG ) ;
1615const connectDynamoDB = ( ) => new AWS . DynamoDB ( CLIENT_CONFIG ) ;
Original file line number Diff line number Diff line change 1+ import datetime
12import os
23import time
34import uuid
4- import datetime
5+
56import boto3
67
7- LOCALSTACK_HOSTNAME = os .environ .get ("LOCALSTACK_HOSTNAME" )
8- ENDPOINT = f'http://{ LOCALSTACK_HOSTNAME } :4566'
8+ AWS_ENDPOINT_URL = os .environ .get ("AWS_ENDPOINT_URL" )
99
1010DYNAMODB_TABLE = 'appRequests'
1111S3_BUCKET = os .environ .get ('ARCHIVE_BUCKET' ) or 'archive-bucket'
@@ -43,7 +43,7 @@ def archive_result(event, context=None):
4343
4444
4545def get_client (resource ):
46- kwargs = {"endpoint_url" : ENDPOINT } if LOCALSTACK_HOSTNAME else {}
46+ kwargs = {"endpoint_url" : AWS_ENDPOINT_URL } if AWS_ENDPOINT_URL else {}
4747 return boto3 .client (resource , ** kwargs )
4848
4949
Original file line number Diff line number Diff line change 11require 'aws-sdk-states'
22
3- $localstack_hostname = ENV [ 'LOCALSTACK_HOSTNAME' ]
4- $endpoint = "http://#{ $localstack_hostname} :4566"
5- if $localstack_hostname
3+ $aws_endpoint_url = ENV [ 'AWS_ENDPOINT_URL' ]
4+ if $aws_endpoint_url
65 ENV [ 'AWS_SECRET_ACCESS_KEY' ] = 'test'
76 ENV [ 'AWS_ACCESS_KEY_ID' ] = 'test'
87end
98$state_machine_arn = ENV [ 'STATE_MACHINE_ARN' ]
109
1110def triggerProcessing ( event :, context :)
12- if $localstack_hostname
13- client = Aws ::States ::Client . new ( :endpoint => $endpoint )
11+ if $aws_endpoint_url
12+ client = Aws ::States ::Client . new ( :endpoint => $aws_endpoint_url )
1413 else
1514 client = Aws ::States ::Client . new ( )
1615 end
You can’t perform that action at this time.
0 commit comments