How to use where clause in Knex
Create refunds with Stripe
Load HTML with Cheerio
How to send POST request with Axios
Find intersection of array in Lodash
Powered by Official white Bloop logo with a period

Terms / Privacy / Search / Support

  • // The code below shows an example of how to instantiate this type.
    // The values are placeholders you should change.
    import * as lambda from '@aws-cdk/aws-lambda';
    import * as secretsmanager from '@aws-cdk/aws-secretsmanager';
    import * as cdk from '@aws-cdk/core';
    
    declare const function_: lambda.Function;
    declare const hostedRotation: secretsmanager.HostedRotation;
    declare const secret: secretsmanager.Secret;
    const rotationScheduleProps: secretsmanager.RotationScheduleProps = {
      secret: secret,
    
      // the properties below are optional
      automaticallyAfter: cdk.Duration.minutes(30),
      hostedRotation: hostedRotation,
      rotationLambda: function_,
    };
    
    Docs
  • 
    /* This example shows how to update the KMS customer managed key (CMK) used to encrypt the secret value. The KMS CMK must be in the same region as the secret. */
    
     var params = {
      KmsKeyId: "arn:aws:kms:us-west-2:123456789012:key/EXAMPLE2-90ab-cdef-fedc-ba987EXAMPLE", 
      SecretId: "MyTestDatabaseSecret"
     };
     secretsmanager.updateSecret(params, function(err, data) {
       if (err) console.log(err, err.stack); // an error occurred
       else     console.log(data);           // successful response
       /*
       data = {
        ARN: "arn:aws:secretsmanager:us-west-2:123456789012:secret:MyTestDatabaseSecret-a1b2c3", 
        Name: "MyTestDatabaseSecret"
       }
       */
     });
    Docs
  • // Read the secret from Secrets Manager
    const pipeline = new codepipeline.Pipeline(this, 'MyPipeline');
    const sourceOutput = new codepipeline.Artifact();
    const sourceAction = new codepipeline_actions.GitHubSourceAction({
      actionName: 'GitHub_Source',
      owner: 'awslabs',
      repo: 'aws-cdk',
      oauthToken: SecretValue.secretsManager('my-github-token'),
      output: sourceOutput,
      branch: 'develop', // default: 'master'
    });
    pipeline.addStage({
      stageName: 'Source',
      actions: [sourceAction],
    });
    
    Docs
  • import { SecretsManagerClient, ListSecretsCommand } from "@aws-sdk/client-secrets-manager"; // ES Modules import
    // const { SecretsManagerClient, ListSecretsCommand } = require("@aws-sdk/client-secrets-manager"); // CommonJS import
    const client = new SecretsManagerClient(config);
    const command = new ListSecretsCommand(input);
    const response = await client.send(command);
    
    Docs
  • import * as AWS from "@aws-sdk/client-secrets-manager";
    const client = new AWS.SecretsManager({ region: "REGION" });
    
    // async/await.
    try {
      const data = await client.cancelRotateSecret(params);
      // process data.
    } catch (error) {
      // error handling.
    }
    
    // Promises.
    client
      .cancelRotateSecret(params)
      .then((data) => {
        // process data.
      })
      .catch((error) => {
        // error handling.
      });
    
    // callbacks.
    client.cancelRotateSecret(params, (err, data) => {
      // proccess err and data.
    });
    
    Docs
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples