-
Notifications
You must be signed in to change notification settings - Fork 7
Iac pr #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Iac pr #2
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,54 @@ | ||||||||||||
| AWSTemplateFormatVersion: '2010-09-09' | ||||||||||||
| Metadata: | ||||||||||||
| License: Apache-2.0 | ||||||||||||
| Description: 'AWS CloudFormation Sample Template DynamoDB_Table: This template demonstrates | ||||||||||||
| the creation of a DynamoDB table. **WARNING** This template creates an Amazon DynamoDB | ||||||||||||
| table. You will be billed for the AWS resources used if you create a stack from | ||||||||||||
| this template.' | ||||||||||||
| Parameters: | ||||||||||||
| HashKeyElementName: | ||||||||||||
| Description: HashType PrimaryKey Name | ||||||||||||
| Type: String | ||||||||||||
| AllowedPattern: '[a-zA-Z0-9]*' | ||||||||||||
| MinLength: '1' | ||||||||||||
| MaxLength: '2048' | ||||||||||||
| ConstraintDescription: must contain only alphanumberic characters | ||||||||||||
| HashKeyElementType: | ||||||||||||
| Description: HashType PrimaryKey Type | ||||||||||||
| Type: String | ||||||||||||
| Default: S | ||||||||||||
| AllowedPattern: '[S|N]' | ||||||||||||
| MinLength: '1' | ||||||||||||
| MaxLength: '1' | ||||||||||||
| ConstraintDescription: must be either S or N | ||||||||||||
| ReadCapacityUnits: | ||||||||||||
| Description: Provisioned read throughput | ||||||||||||
| Type: Number | ||||||||||||
| Default: '5' | ||||||||||||
| MinValue: '5' | ||||||||||||
| MaxValue: '10000' | ||||||||||||
| ConstraintDescription: must be between 5 and 10000 | ||||||||||||
| WriteCapacityUnits: | ||||||||||||
| Description: Provisioned write throughput | ||||||||||||
| Type: Number | ||||||||||||
| Default: '10' | ||||||||||||
| MinValue: '5' | ||||||||||||
| MaxValue: '10000' | ||||||||||||
| ConstraintDescription: must be between 5 and 10000 | ||||||||||||
| Resources: | ||||||||||||
| myDynamoDBTable: | ||||||||||||
| Type: AWS::DynamoDB::Table | ||||||||||||
| Properties: | ||||||||||||
| AttributeDefinitions: | ||||||||||||
| - AttributeName: !Ref 'HashKeyElementName' | ||||||||||||
| AttributeType: !Ref 'HashKeyElementType' | ||||||||||||
| KeySchema: | ||||||||||||
| - AttributeName: !Ref 'HashKeyElementName' | ||||||||||||
| KeyType: HASH | ||||||||||||
| ProvisionedThroughput: | ||||||||||||
| ReadCapacityUnits: !Ref 'ReadCapacityUnits' | ||||||||||||
| WriteCapacityUnits: !Ref 'WriteCapacityUnits' | ||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
| Outputs: | ||||||||||||
| TableName: | ||||||||||||
| Value: !Ref 'myDynamoDBTable' | ||||||||||||
| Description: Table name of the newly created DynamoDB table | ||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,64 @@ | ||||||||||||||||||||||
| AWSTemplateFormatVersion: '2010-09-09' | ||||||||||||||||||||||
| Metadata: | ||||||||||||||||||||||
| License: Apache-2.0 | ||||||||||||||||||||||
| Description: 'AWS CloudFormation Sample Template DynamoDB_Secondary_Indexes: Create | ||||||||||||||||||||||
| a DynamoDB table with local and global secondary indexes. **WARNING** This template | ||||||||||||||||||||||
| creates an Amazon DynamoDB table. You will be billed for the AWS resources used | ||||||||||||||||||||||
| if you create a stack from this template.' | ||||||||||||||||||||||
| Parameters: | ||||||||||||||||||||||
| ReadCapacityUnits: | ||||||||||||||||||||||
| Description: Provisioned read throughput | ||||||||||||||||||||||
| Type: Number | ||||||||||||||||||||||
| Default: '5' | ||||||||||||||||||||||
| MinValue: '5' | ||||||||||||||||||||||
| MaxValue: '10000' | ||||||||||||||||||||||
| ConstraintDescription: must be between 5 and 10000 | ||||||||||||||||||||||
| WriteCapacityUnits: | ||||||||||||||||||||||
| Description: Provisioned write throughput | ||||||||||||||||||||||
| Type: Number | ||||||||||||||||||||||
| Default: '10' | ||||||||||||||||||||||
| MinValue: '5' | ||||||||||||||||||||||
| MaxValue: '10000' | ||||||||||||||||||||||
| ConstraintDescription: must be between 5 and 10000 | ||||||||||||||||||||||
| Resources: | ||||||||||||||||||||||
| TableOfBooks: | ||||||||||||||||||||||
| Type: AWS::DynamoDB::Table | ||||||||||||||||||||||
| Properties: | ||||||||||||||||||||||
| AttributeDefinitions: | ||||||||||||||||||||||
| - AttributeName: Title | ||||||||||||||||||||||
| AttributeType: S | ||||||||||||||||||||||
| - AttributeName: Category | ||||||||||||||||||||||
| AttributeType: S | ||||||||||||||||||||||
| - AttributeName: Language | ||||||||||||||||||||||
| AttributeType: S | ||||||||||||||||||||||
| KeySchema: | ||||||||||||||||||||||
| - AttributeName: Category | ||||||||||||||||||||||
| KeyType: HASH | ||||||||||||||||||||||
| - AttributeName: Title | ||||||||||||||||||||||
| KeyType: RANGE | ||||||||||||||||||||||
| ProvisionedThroughput: | ||||||||||||||||||||||
| ReadCapacityUnits: !Ref 'ReadCapacityUnits' | ||||||||||||||||||||||
| WriteCapacityUnits: !Ref 'WriteCapacityUnits' | ||||||||||||||||||||||
| LocalSecondaryIndexes: | ||||||||||||||||||||||
| - IndexName: LanguageIndex | ||||||||||||||||||||||
| KeySchema: | ||||||||||||||||||||||
| - AttributeName: Category | ||||||||||||||||||||||
| KeyType: HASH | ||||||||||||||||||||||
| - AttributeName: Language | ||||||||||||||||||||||
| KeyType: RANGE | ||||||||||||||||||||||
| Projection: | ||||||||||||||||||||||
| ProjectionType: KEYS_ONLY | ||||||||||||||||||||||
| GlobalSecondaryIndexes: | ||||||||||||||||||||||
| - IndexName: TitleIndex | ||||||||||||||||||||||
| KeySchema: | ||||||||||||||||||||||
| - AttributeName: Title | ||||||||||||||||||||||
| KeyType: HASH | ||||||||||||||||||||||
| Projection: | ||||||||||||||||||||||
| ProjectionType: KEYS_ONLY | ||||||||||||||||||||||
| ProvisionedThroughput: | ||||||||||||||||||||||
| ReadCapacityUnits: !Ref 'ReadCapacityUnits' | ||||||||||||||||||||||
| WriteCapacityUnits: !Ref 'WriteCapacityUnits' | ||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||
| WriteCapacityUnits: !Ref 'WriteCapacityUnits' | |
| WriteCapacityUnits: !Ref 'WriteCapacityUnits' | |
| PointInTimeRecoverySpecification: | |
| PointInTimeRecoveryEnabled: True | |
| Outputs: |
DynamoDB PITR is disabled
Resource: AWS::DynamoDB::Table.TableOfBooks | Checkov ID: CKV_AWS_28
Description
DynamoDB Point-In-Time Recovery (PITR) is an automatic backup service for DynamoDB table data that helps protect your DynamoDB tables from accidental write or delete operations.
Once enabled, PITR provides continuous backups that can be controlled using various programmatic parameters.
PITR can also be used to restore table data from any point in time during the last 35 days, as well as any incremental backups of DynamoDB tables.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| @description('Name of environment') | ||
| param env string = 'dev' | ||
|
|
||
| @description('Default location for all resources') | ||
| param location string = resourceGroup().location | ||
|
|
||
| var name = 'bicepgoat' | ||
|
|
||
| resource aksCluster 'Microsoft.ContainerService/managedClusters@2021-02-01' = { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| name: '${name}-aks-${env}' | ||
| location: location | ||
|
|
||
| identity: { | ||
| type: 'SystemAssigned' | ||
| } | ||
| properties: { | ||
| kubernetesVersion: '1.19.7' | ||
| dnsPrefix: '${name}-${env}' | ||
| enableRBAC: false | ||
|
|
||
| agentPoolProfiles: [ | ||
| { | ||
| name: 'default' | ||
| count: 2 | ||
| vmSize: 'Standard_D2_v2' | ||
| } | ||
| ] | ||
| addonProfiles: { | ||
| omsagent: { | ||
| enabled: false | ||
| } | ||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resource: AWS::DynamoDB::Table.myDynamoDBTable | Checkov ID: CKV_AWS_28
Description
DynamoDB Point-In-Time Recovery (PITR) is an automatic backup service for DynamoDB table data that helps protect your DynamoDB tables from accidental write or delete operations.
Once enabled, PITR provides continuous backups that can be controlled using various programmatic parameters.
PITR can also be used to restore table data from any point in time during the last 35 days, as well as any incremental backups of DynamoDB tables.