-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.yaml
69 lines (63 loc) · 1.95 KB
/
template.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
Description: Dummy ressources to test the package
Resources:
RepoSuperagentAwsSignTestRole:
Type: AWS::IAM::Role
Properties:
RoleName: RepoSuperagentAwsSignSignTestRole
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Principal:
AWS: '*'
Action: sts:AssumeRole
RepoSuperagentAwsSignTestApi:
Type: AWS::Serverless::Api
Properties:
Name: sam-repo-superagent-aws-sign
StageName: prod
Auth:
DefaultAuthorizer: AWS_IAM
InvokeRole: !GetAtt RepoSuperagentAwsSignTestRole.Arn
DefinitionBody:
swagger: '2.0'
info:
title: Test API
version: '1.0'
paths:
/ping:
get:
responses:
'200':
description: Successful response
content:
application/json:
schema: {}
x-amazon-apigateway-integration:
type: mock
requestTemplates:
application/json: '{ "statusCode": 200 }'
responses:
default:
statusCode: '200'
RepoSuperagentAwsSignTestRolePolicy:
Type: AWS::IAM::Policy
Properties:
PolicyName: RepoSuperagentAwsSignTestRolePolicy
Roles:
- !Ref RepoSuperagentAwsSignTestRole
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action:
- execute-api:Invoke
Resource:
- !Sub 'arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:${RepoSuperagentAwsSignTestApi}/*'
Outputs:
TestRoleArn:
Value: !GetAtt RepoSuperagentAwsSignTestRole.Arn
TestApiEndpoint:
Value: !Sub 'https://${RepoSuperagentAwsSignTestApi}.execute-api.${AWS::Region}.amazonaws.com/prod/ping'