forked from tinyg210/shipment-list-demo
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from localstack-samples/app_updates
App updates
- Loading branch information
Showing
12 changed files
with
58 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 0 additions & 33 deletions
33
...ator/src/main/java/dev/ancaghenade/shipmentpicturelambdavalidator/PropertiesProvider.java
This file was deleted.
Oops, something went wrong.
40 changes: 19 additions & 21 deletions
40
...lidator/src/main/java/dev/ancaghenade/shipmentpicturelambdavalidator/SNSClientHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,33 @@ | ||
package dev.ancaghenade.shipmentpicturelambdavalidator; | ||
|
||
import software.amazon.awssdk.services.sns.SnsClient; | ||
|
||
import java.net.URI; | ||
import java.util.Objects; | ||
import software.amazon.awssdk.services.sns.SnsClient; | ||
|
||
public class SNSClientHelper { | ||
|
||
private static final String AWS_ENDPOINT_URL = System.getenv("AWS_ENDPOINT_URL"); | ||
private static String snsTopicArn; | ||
private static final String AWS_ENDPOINT_URL = System.getenv("AWS_ENDPOINT_URL"); | ||
private static String snsTopicArn; | ||
|
||
public static SnsClient getSnsClient() { | ||
public static SnsClient getSnsClient() { | ||
|
||
var clientBuilder = SnsClient.builder(); | ||
var clientBuilder = SnsClient.builder(); | ||
|
||
if (Objects.nonNull(AWS_ENDPOINT_URL)) { | ||
snsTopicArn = String.format("arn:aws:sns:%s:000000000000:update_shipment_picture_topic", | ||
Location.REGION.getRegion()); | ||
if (Objects.nonNull(AWS_ENDPOINT_URL)) { | ||
snsTopicArn = System.getenv("SNS_TOPIC_ARN_DEV"); | ||
|
||
return clientBuilder | ||
.region(Location.REGION.getRegion()) | ||
.endpointOverride(URI.create(AWS_ENDPOINT_URL)) | ||
.build(); | ||
} else { | ||
snsTopicArn = String.format("arn:aws:sns:%s:%s:update_shipment_picture_topic", | ||
Location.REGION.getRegion(), "932043840972"); | ||
return clientBuilder.build(); | ||
return clientBuilder | ||
.region(Location.REGION.getRegion()) | ||
.endpointOverride(URI.create(AWS_ENDPOINT_URL)) | ||
.build(); | ||
} else { | ||
snsTopicArn = System.getenv("SNS_TOPIC_ARN_PROD"); | ||
return clientBuilder.build(); | ||
} | ||
} | ||
public static String topicARN() { | ||
return snsTopicArn; | ||
} | ||
} | ||
|
||
public static String topicARN() { | ||
return snsTopicArn; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
shipment-picture-bucket=shipment-picture-bucket-concise-malamute | ||
shipment-picture-bucket-validator=shipment-picture-lambda-validator-bucket-concise-malamute | ||
shipment-picture-bucket=shipment-picture-bucket-certain-yak | ||
shipment-picture-bucket-validator=shipment-picture-lambda-validator-bucket-certain-yak |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
locals { | ||
json_data = file("./data.json") | ||
tf_data = jsondecode(local.json_data) | ||
sns_topic_arn_prod = "arn:aws:sns:${var.aws_region}:${var.account_id}:${var.sns_topic_name}" | ||
sns_topic_arn_dev = "arn:aws:sns:${var.aws_region}:000000000000:${var.sns_topic_name}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters