Skip to content

Commit

Permalink
draft app resiliencehub (#29)
Browse files Browse the repository at this point in the history
* draft

* fix pipeline

* wip

* wip

* wip
  • Loading branch information
pethers authored Apr 8, 2023
1 parent 76376dc commit 300efed
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@ jobs:
uses: scottbrenner/cfn-lint-action@v2
with:
command: cfn-lint -t cloudformation/template.yml
- name: Testing route53 with CFN Lint
uses: scottbrenner/cfn-lint-action@v2
with:
command: cfn-lint -t cloudformation/route53.yml
- name: Testing disaster-recovery with CFN Lint
uses: scottbrenner/cfn-lint-action@v2
with:
command: cfn-lint -t cloudformation/disaster-recovery.yml
- name: Run cfn-nag
uses: stelligent/cfn_nag@master
with:
input_path: cloudformation
- name: Testing app with CFN Lint
uses: scottbrenner/cfn-lint-action@v2
with:
command: cfn-lint -t cloudformation/app.yml
- name: Run cfn-nag
uses: stelligent/cfn_nag@master
with:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ jobs:
uses: scottbrenner/cfn-lint-action@v2
with:
command: cfn-lint -t cloudformation/disaster-recovery.yml
- name: Testing app with CFN Lint
uses: scottbrenner/cfn-lint-action@v2
with:
command: cfn-lint -t cloudformation/app.yml
- name: Run cfn-nag
uses: stelligent/cfn_nag@master
with:
Expand All @@ -39,4 +43,4 @@ jobs:
framework: cloudformation
output_format: sarif
output_file_path: reports/results.sarif
download_external_modules: true
download_external_modules: true
39 changes: 39 additions & 0 deletions cloudformation/app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
AWSTemplateFormatVersion: '2010-09-09'
Description: ResilienceHub Application
Parameters:
StackIrland:
Description: Arn for StackIrland
Type: String
Default: ''
StackFrankfurt:
Description: Arn for StackFrankfurt
Type: String
Default: ''
AppPolicy:
Description: Arn for Policy
Type: String
Default: ''
Resources:
Application:
Type: AWS::ResilienceHub::App
Properties:
AppAssessmentSchedule: Daily
AppTemplateBody: !Sub '{"resources":[{"logicalResourceId":{"identifier":"RestApi","logicalStackName":"${StackIrland}","resourceGroupName":null},"type":"AWS::ApiGateway::RestApi","name":"apigatewayrestapi-1"},{"logicalResourceId":{"identifier":"LambdaDynamo","logicalStackName":"${StackIrland}","resourceGroupName":null},"type":"AWS::Lambda::Function","name":"lambdafunction-2"},{"logicalResourceId":{"identifier":"DeadLetterTopic","logicalStackName":"${StackIrland}","resourceGroupName":null},"type":"AWS::SNS::Topic","name":"snstopic"},{"logicalResourceId":{"identifier":"DeadLetterTopic","logicalStackName":"lambda-vpc","resourceGroupName":null},"type":"AWS::SNS::Topic","name":"snstopic-1"},{"logicalResourceId":{"identifier":"LambdaDynamo","logicalStackName":"lambda-vpc","resourceGroupName":null},"type":"AWS::Lambda::Function","name":"lambdafunction-1"},{"logicalResourceId":{"identifier":"Lambda","logicalStackName":"lambda-vpc","resourceGroupName":null},"type":"AWS::Lambda::Function","name":"lambdafunction-3"},{"logicalResourceId":{"identifier":"RestApi","logicalStackName":"lambda-vpc","resourceGroupName":null},"type":"AWS::ApiGateway::RestApi","name":"apigatewayrestapi"},{"logicalResourceId":{"identifier":"Lambda","logicalStackName":"${StackIrland}","resourceGroupName":null},"type":"AWS::Lambda::Function","name":"lambdafunction"},{"logicalResourceId":{"identifier":"GlobalTable","logicalStackName":"${StackIrland}","resourceGroupName":null},"type":"AWS::DynamoDB::GlobalTable","name":"dynamodbglobaltable"}],"appComponents":[{"id":null,"name":"NotificationAppComponent-SNSTopic-DeadLetterTopic","type":"AWS::ResilienceHub::NotificationAppComponent","resourceNames":["snstopic","snstopic-1"]},{"id":null,"name":"ComputeAppComponent-LambdaFunction-LambdaDynamo","type":"AWS::ResilienceHub::ComputeAppComponent","resourceNames":["lambdafunction-1","lambdafunction-2"]},{"id":null,"name":"ComputeAppComponent-ApiGatewayRestApi-RestApi","type":"AWS::ResilienceHub::ComputeAppComponent","resourceNames":["apigatewayrestapi","apigatewayrestapi-1"]},{"id":null,"name":"ComputeAppComponent-LambdaFunction-Lambda","type":"AWS::ResilienceHub::ComputeAppComponent","resourceNames":["lambdafunction","lambdafunction-3"]},{"id":null,"name":"DatabaseAppComponent-DynamoDBTable-GlobalTable","type":"AWS::ResilienceHub::DatabaseAppComponent","resourceNames":["dynamodbglobaltable"]},{"id":null,"name":"appcommon","type":"AWS::ResilienceHub::AppCommonAppComponent","resourceNames":[]}],"excludedResources":{"logicalResourceIds":[{"identifier":"dns","logicalStackName":"","resourceGroupName":"","terraformSourceName":"","eksSourceName":""}]},"version":2.0}'
Description: lambda-vpc
Name: lambda-vpc
ResiliencyPolicyArn: !Ref 'AppPolicy'
ResourceMappings:
- LogicalStackName: 'StackIrland'
MappingType: CfnStack
PhysicalResourceId:
Identifier: !Sub '"${StackIrland}"'
Type: Arn
- LogicalStackName: 'StackFrankfurt'
MappingType: CfnStack
PhysicalResourceId:
Identifier: !Sub '${StackFrankfurt}'
Type: Arn
Metadata: {}
Outputs:
Application:
Value: !Ref Application

0 comments on commit 300efed

Please sign in to comment.