File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed
python/django_frontend_service/frontend_service_app
springboot/src/main/java/com/amazon/sampleapp Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -49,16 +49,18 @@ def healthcheck(request):
49
49
def aws_sdk_call (request ):
50
50
bucket_name = "e2e-test-bucket-name"
51
51
52
- # Add an (pod) ID to bucketname to associate buckets to specific test runs
53
- ip = request .GET .get ('ip ' , None )
54
- if ip is not None :
55
- bucket_name += "-" + ip
52
+ # Add a unique test ID to bucketname to associate buckets to specific test runs
53
+ testing_id = request .GET .get ('testingId ' , None )
54
+ if testing_id is not None :
55
+ bucket_name += "-" + testing_id
56
56
s3_client = boto3 .client ("s3" )
57
57
try :
58
58
s3_client .get_bucket_location (
59
59
Bucket = bucket_name ,
60
60
)
61
61
except Exception as e :
62
+ # bucket_name does not exist, so this is expected.
63
+ logger .error ("Error occurred when trying to get bucket location of: " + bucket_name )
62
64
logger .error ("Could not retrieve http request:" + str (e ))
63
65
64
66
return get_xray_trace_id ()
Original file line number Diff line number Diff line change @@ -80,18 +80,19 @@ public String healthcheck() {
80
80
// test aws calls instrumentation
81
81
@ GetMapping ("/aws-sdk-call" )
82
82
@ ResponseBody
83
- public String awssdkCall (@ RequestParam (name = "ip " , required = false ) String ip ) {
83
+ public String awssdkCall (@ RequestParam (name = "testingId " , required = false ) String testingId ) {
84
84
String bucketName = "e2e-test-bucket-name" ;
85
- // Add an (pod) ID to bucketname to associate buckets to specific test runs
86
- if (ip != null ) {
87
- bucketName += "-" + ip ;
85
+ // Add a unique test ID to bucketname to associate buckets to specific test runs
86
+ if (testingId != null ) {
87
+ bucketName += "-" + testingId ;
88
88
}
89
89
GetBucketLocationRequest bucketLocationRequest =
90
90
GetBucketLocationRequest .builder ().bucket (bucketName ).build ();
91
91
try {
92
92
s3 .getBucketLocation (bucketLocationRequest );
93
93
} catch (Exception e ) {
94
- // e2e-test-bucket-name does not exist, so this is expected.
94
+ // bucketName does not exist, so this is expected.
95
+ logger .error ("Error occurred when trying to get bucket location of: " + bucketName );
95
96
logger .error ("Could not retrieve http request:" + e .getLocalizedMessage ());
96
97
}
97
98
return getXrayTraceId ();
You can’t perform that action at this time.
0 commit comments