-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfailing-stack.yaml
More file actions
40 lines (36 loc) · 1.12 KB
/
failing-stack.yaml
File metadata and controls
40 lines (36 loc) · 1.12 KB
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
AWSTemplateFormatVersion: '2010-09-09'
Description: 'Template designed to fail during deployment for stack ID testing'
Parameters:
Environment:
Type: String
Default: test
Resources:
# This will fail because we're trying to create a bucket with an invalid name
FailingBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: "INVALID_BUCKET_NAME_WITH_UPPERCASE_AND_UNDERSCORES"
# This Lambda will fail because the code doesn't exist
FailingLambda:
Type: AWS::Lambda::Function
Properties:
FunctionName: !Sub "failing-lambda-${Environment}"
Runtime: python3.9
Handler: index.handler
Code:
ZipFile: |
# This will cause a runtime error
import nonexistent_module
def handler(event, context):
return nonexistent_module.do_something()
Role: !GetAtt FailingRole.Arn
FailingRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service: lambda.amazonaws.com
Action: sts:AssumeRole