Skip to content

Commit

Permalink
Adding support for nested stack generation in QSAssetsCFNSynthesizer …
Browse files Browse the repository at this point in the history
…and also improved code and readme file
  • Loading branch information
enriquh committed Dec 9, 2024
1 parent 9c18bb4 commit 1539cee
Show file tree
Hide file tree
Showing 18 changed files with 1,925 additions and 418 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### vsCode ###
.vscode
**/**.code-workspace

### macOS ###
# General
Expand All @@ -17,6 +18,7 @@

**/node_modules
**/dist
**/__pycache__
**/build
**/.DS_Store
**/.angular
Expand All @@ -25,3 +27,4 @@ cdk.out
**/data/**.csv

.env
workspace/
104 changes: 63 additions & 41 deletions README.md

Large diffs are not rendered by default.

122 changes: 79 additions & 43 deletions deploy.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@ Resources:
ExecutionRole:
Type: AWS::IAM::Role
Properties:
RoleName: !Ref ExecutionRoleName
RoleName:
Ref: ExecutionRoleName
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Principal:
AWS:
- !Ref AdministratorAccountId
- Ref: AdministratorAccountId
Action:
- sts:AssumeRole
Path: /
ManagedPolicyArns:
- !Sub arn:${AWS::Partition}:iam::aws:policy/AdministratorAccess
- Fn::Sub: arn:${AWS::Partition}:iam::aws:policy/AdministratorAccess
72 changes: 56 additions & 16 deletions deployment/CFNStacks/deploymentAccount_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,10 @@ Parameters:
Description: Region where QuickSight assets are hosted
Type: String
Default: "us-east-1"
SrcQSAdminRegion:
Description: Admin region for your QS source account where your users are hosted
Type: String
Default: "us-east-1"
DestQSAdminRegion:
Description: Admin region for your QS destination account where your users are hosted
Type: String
Default: "us-east-1"
QSUser:
Description: QS Username in Account where the assets will be created
Type: String
AccountAdminARN:
Description: IAM ARN that will be responsible for administering the Account (it will be able to manage the created KMS key for encryption). Eg your role/user arn
Type: String
Default: role/Administrator
Stage1Name:
Description: Name of the first stage in the pipeline, e.g. DEV
Type: String
Default: DEV
Stage2Name:
Description: Name of the first stage in the pipeline, e.g. PRE
Type: String
Expand Down Expand Up @@ -146,6 +131,8 @@ Resources:
Status: Enabled
VersioningConfiguration:
Status: Enabled
WebsiteConfiguration:
IndexDocument: index.hmtl
NotificationConfiguration:
EventBridgeConfiguration:
EventBridgeEnabled: true
Expand Down Expand Up @@ -229,6 +216,7 @@ Resources:
Name:
Ref: PipelineName
PipelineType: V2
ExecutionMode: QUEUED
RoleArn:
Fn::GetAtt: CodePipelineRole.Arn
ArtifactStore:
Expand Down Expand Up @@ -295,7 +283,7 @@ Resources:
Ref: QuickSightRegion
StackSetName:
Fn::Sub: ${PipelineName}-QSSourceAssets
TemplatePath: SourceAssetsArtifact::QStemplate_CFN_SOURCE.yaml
TemplatePath: SourceAssetsArtifact::QS_assets_CFN_SOURCE.yaml
Parameters:
Fn::Sub: SourceAssetsArtifact::source_cfn_template_parameters_${Stage2Name}.txt
InputArtifacts:
Expand Down Expand Up @@ -550,6 +538,58 @@ Resources:
- Fn::Sub: "arn:aws:s3:::${PipelineS3BucketName}"
- Fn::Sub: "arn:aws:s3:::${PipelineS3BucketName}/*"
Sid: VisualEditor0
- Action:
- dynamodb:BatchGetItem
- dynamodb:BatchWriteItem
- dynamodb:ConditionCheckItem
- dynamodb:PutItem
- dynamodb:DescribeTable
- dynamodb:DeleteItem
- dynamodb:GetItem
- dynamodb:Scan
- dynamodb:Query
- dynamodb:UpdateItem
Effect: Allow
Resource:
- Fn::Sub: arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/QSAssetParameters-${PipelineName}
- Fn::Sub: arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/QSTrackedAssets-${PipelineName}
paramDDBTable:
Type: AWS::DynamoDB::Table
Properties:
AttributeDefinitions:
- AttributeName: StageName
AttributeType: S
- AttributeName: AssetType
AttributeType: S
KeySchema:
- AttributeName: StageName
KeyType: HASH
- AttributeName: AssetType
KeyType: RANGE
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
TableName:
Fn::Sub: QSAssetParameters-${PipelineName}

trackedAssetsTable:
Type: AWS::DynamoDB::Table
Properties:
AttributeDefinitions:
- AttributeName: AssetId
AttributeType: S
- AttributeName: AssetType
AttributeType: S
KeySchema:
- AttributeName: AssetId
KeyType: HASH
- AttributeName: AssetType
KeyType: RANGE
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
TableName:
Fn::Sub: QSTrackedAssets-${PipelineName}
Outputs:
Codepipeline:
Description: Link to the codepipeline created to implement QuickSight CI/CD
Expand Down
Loading

0 comments on commit 1539cee

Please sign in to comment.