Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@awssolutions/cdf-assetlibrary-history",
"comment": "expose dynamo capacity values through cloudformation",
"type": "none"
}
],
"packageName": "@awssolutions/cdf-assetlibrary-history"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@awssolutions/cdf-installer",
"comment": "expose dynamo capacity values in the installer",
"type": "none"
}
],
"packageName": "@awssolutions/cdf-installer"
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ Parameters:
- 'false'
MinLength: 1

DynamoProvisionedThroughputCapacity:
Description: The Read/Write units to provision on the dynamo table
Type: Number
Default: 5

Conditions:
DeployInVPC: !Not [!Equals [!Ref VpcId, 'N/A']]
DeployWithLambdaAuth:
Expand Down Expand Up @@ -248,6 +253,7 @@ Resources:
reason: 'Can be decided by the customer, to specify the billing mode'
Properties:
TableName: !Sub 'cdf-assetlibraryhistory-${Environment}'
BillingMode: 'PROVISIONED'
PointInTimeRecoverySpecification:
PointInTimeRecoveryEnabled: true
SSESpecification:
Expand Down Expand Up @@ -279,11 +285,11 @@ Resources:
Projection:
ProjectionType: ALL
ProvisionedThroughput:
ReadCapacityUnits: '5'
WriteCapacityUnits: '5'
ReadCapacityUnits: !Ref DynamoProvisionedThroughputCapacity
WriteCapacityUnits: !Ref DynamoProvisionedThroughputCapacity
ProvisionedThroughput:
ReadCapacityUnits: '5'
WriteCapacityUnits: '5'
ReadCapacityUnits: !Ref DynamoProvisionedThroughputCapacity
WriteCapacityUnits: !Ref DynamoProvisionedThroughputCapacity

EventsLambdaFunction:
Type: AWS::Serverless::Function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,22 @@ export class AssetLibraryHistoryInstaller implements RestModule {
public async prompts(answers: Answers): Promise<Answers> {
delete answers.assetLibraryHistory?.redeploy;
let updatedAnswers: Answers = await inquirer.prompt(
[redeployIfAlreadyExistsPrompt(this.name, this.stackName)],
[
redeployIfAlreadyExistsPrompt(this.name, this.stackName),
{
message: `Provisioned Capacity for the dynamo table?`,
type: 'input',
name: 'assetLibraryHistory.dynamoCapacity',
default: answers.assetLibraryHistory?.dynamoCapacity ?? 5,
askAnswered: true,
validate(answer: number) {
if (answer > 0) {
return 'Capacity must be greater than 0';
}
return true;
},
},
],
answers
);
if ((updatedAnswers.assetLibraryHistory?.redeploy ?? true) === false) {
Expand Down Expand Up @@ -75,6 +90,7 @@ export class AssetLibraryHistoryInstaller implements RestModule {
`ApiGatewayDefinitionTemplate=${answers.apigw.cloudFormationTemplate}`,
`AuthType=${answers.apigw.type}`,
`KmsKeyId=${answers.kms.id}`,
`DynamoProvisionedThroughputCapacity=${answers.assetLibraryHistory.dynamoCapacity}`,
];

const addIfSpecified = (key: string, value: unknown) => {
Expand Down
12 changes: 7 additions & 5 deletions source/packages/services/installer/src/models/answers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ export interface ProvisionedConcurrencyModuleAttribues extends ServiceModuleAttr
}

export interface NeptuneScalingAttributes {
minNeptuneReadReplicaCapacity?: number;
maxNeptuneReadReplicaCapacity?: number;
enableNeptuneAutoScaling?: boolean;
neptuneTargetUtilization?: number;
minNeptuneReadReplicaCapacity?: number;
maxNeptuneReadReplicaCapacity?: number;
enableNeptuneAutoScaling?: boolean;
neptuneTargetUtilization?: number;
}
export interface RestServiceModuleAttribues extends ServiceModuleAttributes {
enableCustomDomain?: boolean;
Expand Down Expand Up @@ -160,7 +160,9 @@ export interface AssetLibraryExport extends ServiceModuleAttributes {
loadPath?: string;
}

export type AssetLibraryHistory = RestServiceModuleAttribues;
export interface AssetLibraryHistory extends RestServiceModuleAttribues {
dynamoCapacity?: number;
}

export type AuthDeviceCert = ServiceModuleAttributes;

Expand Down