Error encountered when attempting to update AWS CloudFront with exceeded rate allowance

As I attempt to delete a CloudFront distribution using the AWS SDK for JavaScript, I encountered an issue when trying to update it. Each time I send the request, I receive an internal server error stating "Rate exceeded". I have experimented with various values in my configuration settings, but the rate error persists. I am unsure if this is due to a configuration problem or if there is another mistake that I made. On a different note, I have successfully created a function that generates a new distribution without any issues.

The current configuration object appears as follows:

  const originId = `S3-${buckets.build.name}`;
  const originDomain = `${buckets.build.name}.s3.amazonaws.com`;

  const updateParams: CloudFront.UpdateDistributionRequest = {
    [Contents of configuration updated here]
  

Could someone provide insight into what may have caused this error?

Answer №1

Encountered a similar issue when trying to deactivate a CloudFront distribution before removing it. I found a successful solution in Java:

GetDistributionConfigResponse distributionConfigResponse =
            cloudFrontClient.getDistributionConfig(GetDistributionConfigRequest.builder().id(distributionId).build());
   
distributionETag = distributionConfigResponse.eTag();
DistributionConfig originalConfig = distributionConfigResponse.distributionConfig();
        
UpdateDistributionResponse updateDistributionResponse =
            cloudFrontClient.updateDistribution(r -> r.id(distributionId)
                                                      .ifMatch(distributionETag)
                                                      .distributionConfig(originalConfig.toBuilder()
                                                                                        .enabled(false)
                                                                                        .build()));

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

Change the class upon clicking the element

Looking to create a function that toggles classes on elements when specific links are clicked. For example, clicking on link 1 should add the "active" class to the red element, while clicking on link 2 should do the same for the pink element, and so forth. ...

Harnessing the Power of JSON Data Extraction with JavaScript

I stored the data in JSON format using the setItem method: localStorage.setItem('orderproduct', JSON.stringify([{imageSource: productImg, productTitle: title, productQuantity: qty, productPrice: finalprice}])); When I inspect it, this is how it ...

Close overlay panel in PrimeFaces calendar

One of the components I’m currently working with is an overlayPanel that contains a calendar. Here's a snippet of the code: <p:overlayPanel hideEffect="fade" showCloseIcon="true" dismissable="true" > <h:form> <p:p ...

Updating a field in Mongoose by referencing an item from another field that is an array

I have developed an innovative Expense Tracker Application, where users can conveniently manage their expenses through a User Collection containing fields such as Name, Amount, Expenses Array, Incomes Array, and more. The application's database is p ...

Exploring the world of lighting and shadows with Three.js

I have a question about the initialization and animation process. When making changes to elements like lights and shadows, I've noticed that using large values during initialization can cause a significant drop in frames per second at the start. So, I ...

Tips for integrating SQL queries into a document that consists mostly of JavaScript and JQuery

I am currently in the process of integrating a SQL database write into my file that is primarily comprised of JavaScript and jQuery. While I have come across some PHP resources online, I am facing challenges incorporating the PHP code into my existing scri ...

Exchange information among unrelated components

I'm working on implementing a vue event bus to facilitate event communication between my components. In my app.js file, I have included the line Vue.prototype.$eventBus = new Vue();. Within one component, I trigger an event using: this.$eventBus.$emit ...

Various gulp origins and destinations

I am attempting to create the following directory structure -- src |__ app |__ x.ts |__ test |__ y.ts -- build |__ app |__ js |__ test |__ js My goal is to have my generated js files inside buil ...

A more concise approach to crafting ajax requests

Lately, I've been immersed in building various web applications using php, mysql, jquery, and bootstrap. Now, I'm faced with a common issue - how to streamline my ajax queries for posting data? Writing code that is not only functional but also a ...

Executing Promises in an Array through JavaScript

LIVE DEMO Here is a function provided: function isGood(number) { var defer = $q.defer(); $timeout(function() { if (<some condition on number>) { defer.resolve(); } else { defer.reject(); } }, 100); return defer.pro ...

Oops! It seems that caching was forgotten to be configured, causing an error with Babel's plugins after installing Font Awesome on my React app

I wanted to incorporate Font Awesome into my React application, but encountered an error after installing the npm package for Font Awesome: Error: Caching was left unconfigured. Babel's plugins, presets, and .babelrc.js files can be configured for v ...

Tips for modifying an HTML element's attribute when a button is clicked, both in the client and server side

Context: This question delves into the fundamental concepts of AJAX. I have been studying this tutorial along with this example for the JavaScript part, and this resource (the last one on the page) for the PHP segment. Imagine a scenario where a JavaScri ...

Importing a JavaScript file into an Angular 2 application

Currently, I'm in the process of developing an angular2 application using TypeScript. The Situation: Within my project, there exists a module named plugin-map.ts which is structured as follows: import { Type } from '@angular/core'; impor ...

Empty screen appears when "npm run serve" command is executed following the build process

I am currently utilizing Material-ui. Following the project build with npm run build, I encounter a blank page when running npm run serve. I attempted to set homepage: "./" in the package.json as suggested here, however, it still displays a blank ...

Tips on separating/callback functions based on earlier variables

Breaking Down Callback Functions Based on Previous Variables I am trying to figure out how to efficiently break down callback functions that depend on variables defined earlier in the code. Currently, my code resembles a "callback hell" due to my lack of ...

Encountering a glitch while attempting to render with the select tag in React.js

I have developed two functions that generate JSX content and created a logic to display each function based on the user's choice: const Register = () =>{ const [value, setMyValue] = useState() function Zeff(){ return( <div> <h1& ...

When using v-for to render components and <selection>, is there a way to customize it for just one specific instance of the component?

How can I modify the selection in each instance separately when rendering elements of an array obtained from the backend using v-for? Currently, changing one selection affects all instances due to the v-model. Is there a way to target only one selection ...

Typescript - using optional type predicates

I'm looking to create a custom type predicate function that can accurately determine if a number is real and tighten the type as well: function isRealNumber(input: number | undefined | null): input is number { return input !== undefined && ...

The Angular4 HttpClient is throwing an error stating that the type 'Observable<Observable<Object>>' cannot be assigned to the type 'Observable<boolean>'

Currently, I am utilizing the Angular 4 http client to fetch data from the server, but I am encountering an error that states: Type 'Observable<Observable<Object>>' is not assignable to type 'Observable<boolean>'. ...

What is the javascript syntax for retrieving an array from a JSON object?

Hey there, I was wondering how to access an array in Javascript from a JSON object structured like this: Object {results: "success", message: "Your message has been sent successfully", error_id_array: Array[1]} error_id_array: Array[1] 0: "2" le ...