exam questions

Exam ANS-C00 All Questions

View all questions & answers for the ANS-C00 exam

Exam ANS-C00 topic 1 question 12 discussion

Exam question from Amazon's ANS-C00
Question #: 12
Topic #: 1
[All ANS-C00 Questions]

A Lambda function needs to access the private address of an Amazon ElastiCache cluster in a VPC. The Lambda function also needs to write messages to
Amazon SQS. The Lambda function has been configured to run in a subnet in the VPC.
Which of the following actions meet the requirements? (Choose two.)

  • A. The Lambda function needs an IAM role to access Amazon SQS
  • B. The Lambda function must route through a NAT gateway or NAT instance in another subnet to access the public SQS API.
  • C. The Lambda function must be assigned a public IP address to access the public Amazon SQS API.
  • D. The ElastiCache server outbound security group rules must be configured to permit the Lambda function's security group.
  • E. The Lambda function must consume auto-assigned public IP addresses but not elastic IP addresses.
Show Suggested Answer Hide Answer
Suggested Answer: AB 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
route53
Highly Voted 3 years, 8 months ago
I think its AB - If a Lambda function needs to access both VPC resources and the public internet, the VPC needs to have a Network Address Translation (NAT) instance inside the VPC. https://docs.aws.amazon.com/lambda/latest/dg/vpc.html
upvoted 21 times
...
valentijn
Highly Voted 3 years, 8 months ago
A and B. See the first paragraph: https://aws.amazon.com/premiumsupport/knowledge-center/internet-access-lambda-function/
upvoted 5 times
...
PavanKushwah123
Most Recent 2 years, 5 months ago
Correct Answer AC
upvoted 1 times
...
PacoDerek
2 years, 11 months ago
A and D A:https://docs.aws.amazon.com/lambda/latest/dg/with-sqs-example.html it never mentioned anything about internet travers setting. B: its not about the internet access. lambda access SQS within AWS network. Cause +2 DNS resolve SQS with a private IP for lamba, needless travers internet. CE: never heard about assign IP address to lambda, cause its serverless, created without control D: SG is stateless. outbound or inbound all will be the some. u have to permit lambda to access Elasticache
upvoted 2 times
...
RenatoFonseca
3 years, 1 month ago
Selected Answer: AB
An IAM Role is required to provide permission for the Lamba Function interact with SQS. The SQS Queue has a public Endpoint, you need an Internet Gateway or VPC Endpoint to reach it.
upvoted 3 times
...
nil12
3 years, 7 months ago
What about the Elasticache access?
upvoted 1 times
learnwithaniket
3 years, 7 months ago
I am also curious to know. Where is Elastic cache access? I think answer should be A and D.
upvoted 1 times
learnwithaniket
3 years, 7 months ago
Revisited the answers: Elastic Cache outbound security group... wait Lambda has to access the cache. then Inbound security group should allow Lambda SG. Additionally there is default route Local exists for all inter VPC communication. So A and B are the answers.
upvoted 1 times
...
...
...
aws4myself
3 years, 7 months ago
A - For permission to access SQS B - To reach public endpoint of SQS
upvoted 1 times
...
AshishBravo
3 years, 7 months ago
AB, 1. Lambda Function need IAM permission to access SNS Service. 2. When we connect a function to a VPC in account, the function can't access the internet unless our VPC provides access. Internet access from a private subnet requires network address translation (NAT). To give function access to the internet, route outbound traffic to a NAT gateway in a public subnet.
upvoted 1 times
...
ChauPhan
3 years, 7 months ago
Agree with A, B
upvoted 1 times
...
Scunningham99
3 years, 7 months ago
A and b
upvoted 1 times
...
lunt
3 years, 8 months ago
Breakdown. Lambda access private IP of EC cluster. Lambda write messages to SQS. Lambda in a VPC subnet. C. Nope. D. Nope. E. Nope. A. Yes. IAM permissions required to access services. B. Yes. NAT function is the method use. Summary. Assigning Public IPs to Lambda can be done, once the ENI for Lambda is created you can assign a public IP. It's not recommended as a race condition can occur where multiple ENIs are then created for a single IP. NAT GW or NAT instance or VPC are recommended official solutions. Access private address of cluster is a misdirect. Answer is AB.
upvoted 3 times
ChauPhan
3 years, 7 months ago
Is it possible to assign IP to Lambda function? I haven't heard about this. Lambda is called serverless compute service.
upvoted 1 times
...
...
backfringe
3 years, 8 months ago
its A and B
upvoted 1 times
...
awsguru2020
3 years, 8 months ago
Answer is AB
upvoted 3 times
...
BillyC
3 years, 8 months ago
A and B
upvoted 3 times
...
Scunningham99
3 years, 8 months ago
Answer is A & B, C is incorrect as we do not assign lambda a pubic ip, we would only have a route to the internet via the internet gateway. https://aws.amazon.com/premiumsupport/knowledge-center/internet-access-lambda-function/
upvoted 3 times
...
kiaro
3 years, 8 months ago
I could attach EIP to private lambda ENI so, I think its A, B, C I think that maybe The Question has problem
upvoted 2 times
...
2cool2touch
3 years, 8 months ago
Adding to previous comments. B is clear. For A, see https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html which explains the role Lambda needs to execute functions in SQS - "Lambda assumes the role when your function is invoked"
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...