@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
148 lines • 5.43 kB
JavaScript
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.DeploymentConfig = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a CodeDeploy deployment config for an application
*
* ## Example Usage
*
* ### Server Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const foo = new aws.codedeploy.DeploymentConfig("foo", {
* deploymentConfigName: "test-deployment-config",
* minimumHealthyHosts: {
* type: "HOST_COUNT",
* value: 2,
* },
* });
* const fooDeploymentGroup = new aws.codedeploy.DeploymentGroup("foo", {
* appName: fooApp.name,
* deploymentGroupName: "bar",
* serviceRoleArn: fooRole.arn,
* deploymentConfigName: foo.id,
* ec2TagFilters: [{
* key: "filterkey",
* type: "KEY_AND_VALUE",
* value: "filtervalue",
* }],
* triggerConfigurations: [{
* triggerEvents: ["DeploymentFailure"],
* triggerName: "foo-trigger",
* triggerTargetArn: "foo-topic-arn",
* }],
* autoRollbackConfiguration: {
* enabled: true,
* events: ["DEPLOYMENT_FAILURE"],
* },
* alarmConfiguration: {
* alarms: ["my-alarm-name"],
* enabled: true,
* },
* });
* ```
*
* ### Lambda Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const foo = new aws.codedeploy.DeploymentConfig("foo", {
* deploymentConfigName: "test-deployment-config",
* computePlatform: "Lambda",
* trafficRoutingConfig: {
* type: "TimeBasedLinear",
* timeBasedLinear: {
* interval: 10,
* percentage: 10,
* },
* },
* });
* const fooDeploymentGroup = new aws.codedeploy.DeploymentGroup("foo", {
* appName: fooApp.name,
* deploymentGroupName: "bar",
* serviceRoleArn: fooRole.arn,
* deploymentConfigName: foo.id,
* autoRollbackConfiguration: {
* enabled: true,
* events: ["DEPLOYMENT_STOP_ON_ALARM"],
* },
* alarmConfiguration: {
* alarms: ["my-alarm-name"],
* enabled: true,
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import CodeDeploy Deployment Configurations using the `deployment_config_name`. For example:
*
* ```sh
* $ pulumi import aws:codedeploy/deploymentConfig:DeploymentConfig example my-deployment-config
* ```
*/
class DeploymentConfig extends pulumi.CustomResource {
/**
* Get an existing DeploymentConfig resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new DeploymentConfig(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of DeploymentConfig. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === DeploymentConfig.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["computePlatform"] = state?.computePlatform;
resourceInputs["deploymentConfigId"] = state?.deploymentConfigId;
resourceInputs["deploymentConfigName"] = state?.deploymentConfigName;
resourceInputs["minimumHealthyHosts"] = state?.minimumHealthyHosts;
resourceInputs["region"] = state?.region;
resourceInputs["trafficRoutingConfig"] = state?.trafficRoutingConfig;
resourceInputs["zonalConfig"] = state?.zonalConfig;
}
else {
const args = argsOrState;
resourceInputs["computePlatform"] = args?.computePlatform;
resourceInputs["deploymentConfigName"] = args?.deploymentConfigName;
resourceInputs["minimumHealthyHosts"] = args?.minimumHealthyHosts;
resourceInputs["region"] = args?.region;
resourceInputs["trafficRoutingConfig"] = args?.trafficRoutingConfig;
resourceInputs["zonalConfig"] = args?.zonalConfig;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["deploymentConfigId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(DeploymentConfig.__pulumiType, name, resourceInputs, opts);
}
}
exports.DeploymentConfig = DeploymentConfig;
/** @internal */
DeploymentConfig.__pulumiType = 'aws:codedeploy/deploymentConfig:DeploymentConfig';
//# sourceMappingURL=deploymentConfig.js.map
;