-
Notifications
You must be signed in to change notification settings - Fork 12
/
sam_template.yaml
39 lines (38 loc) · 1.08 KB
/
sam_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
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Parameters:
S3TagBucket:
Description: "S3 Bucket that will store the CSV file containing all tagged resources"
Type: String
S3TagKey:
Description: "Name of the S3 key (eg, mytags.csv) corresponding to the file that will store all tagged resources"
Type: String
Default: "mytags.csv"
Resources:
AWSTagsExtractor:
Type: 'AWS::Serverless::Function'
Properties:
FunctionName: AWSTagsExtractor
Handler: aws-tags-extractor.handler
Runtime: python3.6
CodeUri: ./
Timeout: 300
Environment:
Variables:
S3TagBucket: !Ref S3TagBucket
S3TagKey: !Ref S3TagKey
Policies:
- S3CrudPolicy:
BucketName: !Ref S3TagBucket
# - Statement:
# - Action:
# - tag:GetResources
# Resource: "*"
# Effect: Allow
Outputs:
AWSTagsExtractorFunction:
Description: AWS Tags Extractor Serverless Function
Value:
Fn::GetAtt:
- AWSTagsExtractor
- Arn