The Wayback Machine - https://web.archive.org/web/20221101102527/https://repost.aws/
By using AWS re:Post, you agree to the Terms of Use

Learn AWS faster by following popular topics

see all
1/18

Recent questions

see all
1/18

S3 bucket per tenant approach. Can I assign different IAM roles for diefferent users in the amplify project?

Please let me know if this a valid approach or I am missing something fundamental.. **Requirement**: - I need to be able to restrict each tenant users from accessing each other s3 files - and be able to measure each tenant space usage in the s3. **Solution I think to implement**: Upon user signup, we check if this is a sign up by invitation to already existing tenant space or a new registration - if it's a new tenant than we register him in a custom dynamodb table and create an s3 bucket for him - if it's a new user in existing tenant we we only adding him to the IAM Role that can access the tenant s3 bucket **Details**: I currently am using cognito custom attribute to save tenant ID (it's configured to not be changeable by the user itself) and struggle to figure out how I can affect the role mapping in the cognito Identity pool to implement the above logic. Please give me directions to dig further or advises on the overall approach in general. Some of the ideas are taken from this article https://medium.com/@dantasfiles/multi-tenant-aws-amplify-method-2-cognito-groups-38b40ace2e9e and it also suggests to use cognito dynamic groups to differ tenants and it seems to resolve the s3 issue as well, but with dynamic groups sync events won't work, right? > Known limitation: Real-time subscriptions are not supported for dynamic group authorization. https://docs.amplify.aws/cli/graphql/authorization-rules/#user-group-based-data-access There is also this question https://repost.aws/questions/QUW1WibDWjQd2rOll4mDiPMA which suggest to use a lymbda and presigned s3 urls to regulate the access to s3 files based on the tenant logic
0
answers
0
votes
1
views
asked 2 minutes ago

Unable to see X-Ray trace for AWS Batch job

I am running a batch job that starts an EC2 instance and runs a Java application, and I am trying to generate X-Ray trace for the job. In my docker entrypoint I install X-Ray daemon and start it ``` curl https://s3.us-west-2.amazonaws.com/aws-xray-assets.us-west-2/xray-daemon/aws-xray-daemon-3.x.rpm -o /tmp/xray.rpm yum install -v -y /tmp/xray.rpm xray -o -n us-west-2 & ``` My Java code is instrumented as such ``` try { Segment segment = AWSXRay.beginSegment("load-data-segment"); logger.info("Segment started traceID={}, segment", segment.getTraceId(), segment.prettySerialize()); Subsegment subSegment = AWSXRay.beginSubsegment("load-data-sub-segment"); logger.info("started subSegment traceId={}, {}", subSegment.getTraceId(), subSegment.prettySerialize()); subSegment.putAnnotation("job_id", "load-data-job"); ... } finally { logger.info("Ending subsegment {}, {}", subSegment.getTraceId(), subSegment.prettySerialize()); AWSXRay.endSubsegment(); logger.info("Ending segment {}, {}", segment.getTraceId(), segment.prettySerialize()); AWSXRay.endSegment(); } ``` And I can see from CloudWatch log that the daemon is installed and started, and the segments are created and eventually terminated normally. ``` ... EVENTS 1667282262329 Running X-Ray: xray -o -n us-west-2 & 1667282258652 EVENTS 1667282262329 Getting Secret: dev-shared-kc-local.yml 1667282258654 EVENTS 1667282262329 2022-11-01T05:57:38Z [Info] Initializing AWS X-Ray daemon 3.3.5 1667282258658 EVENTS 1667282262329 2022-11-01T05:57:38Z [Info] Using buffer memory limit of 321 MB 1667282258658 EVENTS 1667282262329 2022-11-01T05:57:38Z [Info] 5136 segment buffers allocated 1667282258658 EVENTS 1667282262329 2022-11-01T05:57:38Z [Info] Using region: us-west-2 1667282258679 EVENTS 1667282262329 2022-11-01T05:57:38Z [Info] HTTP Proxy server using X-Ray Endpoint : https://xray.us-west-2.amazonaws.com 1667282258679 EVENTS 1667282262329 2022-11-01T05:57:38Z [Info] Starting proxy http server on 127.0.0.1:2000 1667282258679 ... VENTS 1667282262329 2022-11-01 05:57:41,933 [main] [default] INFO - Segment started traceID=1-6360b555-5161dc6ff45fcca197606de8, segment 1667282261934 EVENTS 1667282262329 2022-11-01 05:57:41,941 [main] [default] INFO - started subSegment traceId=null, { 1667282261941 EVENTS 1667282262329 "name" : "load-data-sub-segment", 1667282261941 EVENTS 1667282262329 "id" : "348f5fd5734d2002", 1667282261941 EVENTS 1667282262329 "start_time" : 1.667282261934E9, 1667282261941 EVENTS 1667282262329 "in_progress" : true 1667282261941 EVENTS 1667282262329 } 1667282261941 ... ... EVENTS 1667282596467 2022-11-01 06:03:16,334 [main] [default] INFO - Ending subsegment null, { 1667282596334 ... EVENTS 1667282596467 2022-11-01 06:03:16,336 [main] [default] INFO - Ending segment 1-6360b555-5161dc6ff45fcca197606de8 ``` However I am completely unable to find any tracing from X-Ray console. I use the queries like `annotation.job_id`, but nothing shows up. I think I have all the necessary polices added to my role (`AWSXRayDaemonWriteAccess`), but I am suspecting if I didn't set it up properly. Where and how can I start debugging this? I feel like completely at wits' end. Thank you for any suggestions!
0
answers
0
votes
1
views
asked 4 hours ago

Recent articles

see all
1/18