Creating a vault in AWS S3 Glacier within a CDK app using TypeScript: A step-by-step guide

Can a CDK app be used to create an AWS S3 Glacier vault using TypeScript? The developer guide does not seem to mention TypeScript as an option: https://docs.aws.amazon.com/amazonglacier/latest/dev/creating-vaults.html

We can set up Intelligent Tiering for an AWS S3 bucket, but that may not be what I am looking for. I came across the JavaScript SDK guide for Creating a S3 Glacier vault, which details how to create the vault - exactly what I need. However, I am unsure if this can be implemented in a CDK TypeScript app.

In my attempt, I tried using the NPM package aws-sdk/client-glacier. After installation, I created a new instance of the GlacierClient class in the cdk.ts file. Unfortunately, building the app proved to be challenging.

https://i.sstatic.net/Y7ukx.png

This is the content of my package.json file:

{

  "name": "cdk-app-2",

  "version": "0.1.0",

  "bin": {

    "cdk-app-2": "bin/cdk-app-2.js"

  },

  "scripts": {

    "build": "tsc",

    "watch": "tsc -w",

    "test": "jest",

    "cdk": "cdk"

  },


  "devDependencies": {

    "@types/jest": "^27.5.2",

    "@types/node": "10.17.27",

    "@types/prettier": "2.6.0",

    "aws-cdk": "2.50.0",

    "jest": "^27.5.1",

    "ts-jest": "^27.1.4",

    "ts-node": "^10.9.1",

    "typescript": "~3.9.7"


  },

  "dependencies": {

    "@aws-sdk/client-glacier": "^3.204.0",

    "aws-cdk-lib": "2.50.0",

    "constructs": "^10.0.0",

    "source-map-support": "^0.5.21"


  }

}


Answer №1

S3 Glacier is not currently compatible with the CDK or CloudFormation.

To work around this limitation, one solution is to utilize a Custom Resource construct. The Custom Resource's role would involve utilizing SDK APIs to manage the vault creation, modification, or deletion. This Custom Resource would be triggered during the deployment phase by CloudFormation. There are various types of Custom Resources available, including the convenient custom_resources.AwsCustomResource for simplified SDK calls. If more precise control is necessary, generating your own Lambda function in conjunction with a cdk.CustomResource may be required.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Identify the nature of the output received after dispatching

I'm developing a functional component within the realm of Redux, and I have configured it to return specific values for a particular action. The new value being returned is derived from a Promise, meaning that if the type is designated as "Ival," the ...

Show variable outside callback function - Ionic2

When working with ionic2, I encountered a situation where I needed to pass a variable from an asynchronous method to my template and other methods within the component file. In the `ngOnInit` method of my controller, I have the following code: ngOnInit() ...

Tips for preserving user information after logging in with firebase authentication

Currently, I have implemented Firebase Authentication in my Angular application to enable users to log in. Here is the login() function within my AuthService: login(email: string, password: string) { return from(firebase.auth().signInWithEmailAndPassw ...

The child component fails to inherit the data types provided by the parent component

I am currently working on setting up a dynamic table that will receive updates from the backend based on actions taken, which is why I need to pass the endpoint and response model. When I try to nest and pass the response type, it seems to get lost in the ...

Incorporate the xml2js JavaScript library with Angular 2 for enhanced functionality

I've been attempting to utilize xml2js as an XML parser within my Angular 2 (RC 1 with TypeScript) web application. Unfortunately, I've encountered several errors without finding a solution that works. Here is the detailed process I followed: ...

Having difficulty building a react.js application using Visual Studio 2019

Currently, I am following a helpful tutorial on creating a react.js application using visual studio. At this stage, the tutorial instructs me to open the command prompt and enter the following command: webpack app.tsx --config webpack-config.js (I have ...

Guide on crafting Mongoose query for MongoDB

In my system, I have defined two document schemas: User and Skill. Each User has a list of skills referenced in the skills attribute. Conversely, each Skill has a list of users who possess that skill referenced in the users attribute. The main goal is t ...

Is it feasible to restrict generic classes for particular functions?

Imagine creating a customized container in TypeScript. Let's consider this straightforward example: class Container<T> { val: T; constructor(t: T) { this.val = t; } } Now, let's say you want to implement a function that can gene ...

Presenting CSV data in a tabular format using Angular and TypeScript

I am facing an issue with uploading a CSV file. Even though the table adjusts to the size of the dataset, it appears as if the CSV file is empty. Could this be due to an error in my code or something specific about the CSV file itself? I'm still learn ...

Encountering a 404 error when trying to deploy an Angular application

After following the Angular documentation for deployment, I am deploying my angular application on github pages. The steps I have taken include: 1. Running "ng build --prod --output-path docs --base-href /<project_name>/". 2. Making a copy of docs/ ...

Ways to enhance a component by incorporating default properties in React/TypeScript

I am looking to enhance a React/TS component (specifically the @mui/x-data-grid DataGrid) by populating the classes prop with my own application classes. Initially, I thought about creating a new component called CustomDataGrid like this: import React fro ...

Using Promise.all for multiple function calls

I have several functions set up like this: private async p1(): Promise<Result> { let p1; // Do some operations. return p1; } private async p5(): Promise<void> { // Make a call to an external API. } Some of these functions c ...

Divs are not being organized into rows correctly due to issues with Bootstrap styling

I have implemented Bootstrap in my Angular application. The stylesheet link is included in my Index.html file as follows: <link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.css"> In addition to that, I have listed Bootstrap a ...

Provider not found: ConnectionBackend – NullInjectorError

I encountered the following error while attempting to load the webpage. Despite trying various suggestions from other sources, I have been unable to find a solution. Below the error stack lies my code. core.js:7187 ERROR Error: Uncaught (in promise): Null ...

Utilizing a navigation menu to display various Strapi Collection pages within a single Angular Component

I have set up a collection in Strapi called Pages and I am looking to display them in the same component using my Navigation Bar Component. However, I am unsure of how to achieve this. Currently, all the data from the Collection is being displayed like th ...

What is the best way to retrieve a string from a URL?

Is there a way to extract only a specific string from a URL provided by an API? For instance: I'm interested in extracting only: photo_xxx-xxx-xxx.png Any suggestions on how to split the URL starting at photo and ending at png? ...

Seems like ngAfterViewInit isn't functioning properly, could it be an error on my end

After implementing my ngAfterViewInit function, I noticed that it is not behaving as expected. I have a hunch that something important may be missing in my code. ngOnInit() { this.dataService.getUsers().subscribe((users) => {this.users = users) ; ...

Once the vuex persist plugin is implemented, I am encountering difficulties in accessing the store within the router

Ever since incorporating the vuex persist plugin, I've been encountering an issue where the store doesn't seem to be accessible in the router. const vuexPersist = new VuexPersist({ key: "vuex", storage: localStorage }); const store = ne ...

I'm encountering an issue in my node application where it is unable to access the push

I am a beginner in the world of node.js and express. Whenever I try to start my application using the command npm start, I encounter an error message saying Cannot Read property push of undefined from my index.js file. The problematic code snippet looks l ...

Unable to access class instance from event handler in Angular 2 and Typescript

In the scenario I'm working on, I need to dynamically add multiple instances of a child component to a template. Each of these child components emits a 'select' event, and each one requires a different event handler within the parent compone ...