Articles → AWS → DependsOn Attribute In AWS CloudFormation
DependsOn Attribute In AWS CloudFormation
Purpose
Create A YAML File
AWSTemplateFormatVersion: "2010-09-09"
Resources:
MyS3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: my-depends-on-example-bucket-gyansangrah
MyLambdaFunction:
Type: AWS::Lambda::Function
DependsOn: MyS3Bucket
Properties:
FunctionName: MyExampleLambda
Handler: index.handler
Role: arn:aws:iam::[account_id]:role/Lambdarole
Runtime: python3.9
Code:
ZipFile: |
def handler(event, context):
print("Lambda executed")
Create A Stack
Output
Posted By - | Karan Gupta |
|
Posted On - | Monday, February 24, 2025 |