Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

230
Views
How to setup lambda to be invoked only by Cognito User Group (aws-sam)

I would like to know how to set up a Lambda Function (AdminFunction) so that it can only be invoked by users in a specified group (AdminUserGroup). My YAML is:

  AdminUserGroup:
    Type: AWS::Cognito::UserPoolGroup
    Properties:
      GroupName: "AdminUserGroup"
      Description: Contains Staff Users
      Precedence: 0
      UserPoolId:
        Ref: UserPool

  AdminFunction:
    Type: AWS::Serverless::Function
    Properties:
      Description: admin functions
      CodeUri: admin/
      Handler: index.lambdaHandler
      Runtime: nodejs12.x
      Environment:
        Variables:
          USERPOOL_ID: !Ref UserPool
          VALUE_A: !Ref SomePropA
          VALUE_B: !Ref SomePropB
          USER_GROUP_ADMIN: !Ref AdminUserGroup
          TABLE_NAME: !Ref DynamoTable
      Policies:
        - DynamoDBCrudPolicy:
            TableName: !Ref DynamoTable
      Events:
        Users:
          Type: Api
          Properties:
            Path: /admin/{proxy+}
            Method: ANY
            Auth:
              Authorizer: << ONLY ADMIN USERS >>
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!