aws-serverless

How to create predefined restApi resource? with explicit name

匆匆过客 提交于 2020-01-06 06:35:25
问题 Below is the SAM template that tries giving explicit name( some_name ) to restApi resource on AWS: SampleApi: Type: AWS::Serverless::Api Properties: Name: some_name But I see the events in stack creation as: User: arn:aws:sts::1111222333344:assumed-role/some-role/i-34454503ea88 is not authorized to perform: apigateway:DELETE on resource: arn:aws:apigateway:us-east-1::/restapis/vxrf0gfs2a where vxrf0gfs2a is the random name of restApi Cloudformation stack creates Api gateway with explicit name

How to create predefined restApi resource? with explicit name

不问归期 提交于 2020-01-06 06:35:22
问题 Below is the SAM template that tries giving explicit name( some_name ) to restApi resource on AWS: SampleApi: Type: AWS::Serverless::Api Properties: Name: some_name But I see the events in stack creation as: User: arn:aws:sts::1111222333344:assumed-role/some-role/i-34454503ea88 is not authorized to perform: apigateway:DELETE on resource: arn:aws:apigateway:us-east-1::/restapis/vxrf0gfs2a where vxrf0gfs2a is the random name of restApi Cloudformation stack creates Api gateway with explicit name

How to design SAM deployer policy? to enforce SAM generated AWS resources to be in PermissionBoundary

吃可爱长大的小学妹 提交于 2019-12-31 06:59:26
问题 we have someAWSAccount assuming someaccountrole with instance profile name p in AWS. Managed policy by name some-permission-boundary is created in this account( someAWSAccount ). Purpose of creating this boundary policy in this account is mentioned below. Requirement is, Resources: HelloWorldFunction: Type: AWS::Serverless::Function Properties: CodeUri: hello-world/ Handler: app.LambdaHandler Runtime: nodejs8.10 Events: MySQSEvent: Type: SQS Properties: Queue: !GetAtt SomeQueue.Arn BatchSize:

What is trusted entities in resulting role definition of Lambda?

岁酱吖の 提交于 2019-12-25 02:33:14
问题 Below is the SAM template, Resources: HelloWorldFunction: Type: AWS::Serverless::Function Properties: CodeUri: hello-world/ Handler: app.LambdaHandler Runtime: nodejs8.10 Policies: - AWSLambdaExecute for which, below is role(JSON) created for Lambda function: { "roleName": "somestack-HelloWorldFunctionRole-AAAAAAAA", "policies": [ {...}, # AWSLambdaExecute {...}, # AWSLambdaSQSQueueExecutionRole {....} # AWSLambdaBasicExecutionRole ], "trustedEntities": [ "lambda.amazonaws.com" ] } What is

Adding PermissionBoundary fails in SAM template

给你一囗甜甜゛ 提交于 2019-12-13 04:26:08
问题 Below is the SAM template: Resources: HelloWorldFunction: Type: AWS::Serverless::Function Properties: CodeUri: hello-world/ Handler: app.LambdaHandler Runtime: nodejs8.10 Events: MySQSEvent: Type: SQS Properties: Queue: !GetAtt SomeQueue.Arn BatchSize: 10 PermissionsBoundary: "arn:aws:iam::${AWS::AccountId}:policy/AddPermission" SomeQueue: Type: AWS::SQS::Queue AddPermission: Type: AWS::IAM::ManagedPolicy Properties: PolicyDocument: Version: 2012-10-17 Statement: - Sid:

Shared Libraries in Java AWS Lambda Project

孤街浪徒 提交于 2019-12-13 04:25:34
问题 In my java class System.loadLibrary() is not able to locate the library files. I have used Gradle build to zip file in below structure: zip mypackage App.class GatewayResponse.class lib set of jars and shared libraries Lambda service is able to load my jar but not libraries. Imagine example.jar and libExample.so are part of my lib directory. From App class: I have created an object of some class in the example.jar and it works fine. when I try to load the library libExample.so using system

Docx Document Serverless S3 Error while Putobject Method

人走茶凉 提交于 2019-12-13 03:54:11
问题 I am stuck in a situation for a long time. I am trying to upload a docx file to S3 bucket , using Serverless framework I was successful in uploading the docx document to S3 bucket.But what happened is, when I opened the document from S3. The document contained a buffer data converted to base64 string. i.e the big string about 23 pages. The docx was corrupted. MY Code exports.putFile = async(event) =>{ try { var bitmap = fs.readFileSync('./test.docx'); let bufferValue = new Buffer(bitmap)

Deploying AWS Serverless lambda Application with AmazonServerlessApplicationRepositoryClient does not work?

丶灬走出姿态 提交于 2019-12-12 16:51:05
问题 I want to deploy my ASP.Net Core Web Application project through a c# console application. It means I am trying to create a serverless lambda application on AWS without AWS Toolkit or CLI command. I want to do this with AWS SDK. For this purpose I added below Nugets : AWSSDK.ServerlessApplicationRepository AWSSDK.Core AWSSDK.Lambda at first step I am making a package with msbuild command. Then Zipped and upload on S3 bucket and in final step I am running below code. It does not show me any

Using serverless-mocha-plugin to test dynamic endpoint

陌路散爱 提交于 2019-12-12 15:16:54
问题 I am creating an API application in NodeJS using the Serverless framework. I have installed the serverless-mocha-plugin and am trying to create some unit tests for my functions. In my serverless.yml file, I have the following endpoints: ... equipmentGetAll: handler: ./api/equipment/equipment.getAll events: - http: path: equipment method: get cors: true equipmentGetOne: handler: ./api/equipment/equipment.getOne events: - http: path: equipment/{po_number} method: get cors: true ... When testing

Lambda - How to create customer managed policy?

本小妞迷上赌 提交于 2019-12-11 18:47:13
问题 Background: IAM policies can be created in two ways: Managed policies(newer way) AWS managed policies Customer managed policies Inline policies(older way) Below SAM template is creating inline policy: Resources: HelloWorldFunction: Type: AWS::Serverless::Function Properties: CodeUri: hello-world/ Handler: app.LambdaHandler Runtime: nodejs8.10 Policies: - Statement: - Sid: AccessToS3Policy Effect: Allow Action: - s3:GetObject - s3:GetObjectACL Resource: 'arn:aws:s3:::some-bucket/*' in the