@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
114 lines • 4.96 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.LoadBalancerBackendServerPolicy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Attaches a load balancer policy to an ELB backend server.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* import * as std from "@pulumi/std";
*
* const wu_tang = new aws.elb.LoadBalancer("wu-tang", {
* name: "wu-tang",
* availabilityZones: ["us-east-1a"],
* listeners: [{
* instancePort: 443,
* instanceProtocol: "http",
* lbPort: 443,
* lbProtocol: "https",
* sslCertificateId: "arn:aws:iam::000000000000:server-certificate/wu-tang.net",
* }],
* tags: {
* Name: "wu-tang",
* },
* });
* const wu_tang_ca_pubkey_policy = new aws.elb.LoadBalancerPolicy("wu-tang-ca-pubkey-policy", {
* loadBalancerName: wu_tang.name,
* policyName: "wu-tang-ca-pubkey-policy",
* policyTypeName: "PublicKeyPolicyType",
* policyAttributes: [{
* name: "PublicKey",
* value: std.file({
* input: "wu-tang-pubkey",
* }).then(invoke => invoke.result),
* }],
* });
* const wu_tang_root_ca_backend_auth_policy = new aws.elb.LoadBalancerPolicy("wu-tang-root-ca-backend-auth-policy", {
* loadBalancerName: wu_tang.name,
* policyName: "wu-tang-root-ca-backend-auth-policy",
* policyTypeName: "BackendServerAuthenticationPolicyType",
* policyAttributes: [{
* name: "PublicKeyPolicyName",
* value: wu_tang_root_ca_pubkey_policy.policyName,
* }],
* });
* const wu_tang_backend_auth_policies_443 = new aws.elb.LoadBalancerBackendServerPolicy("wu-tang-backend-auth-policies-443", {
* loadBalancerName: wu_tang.name,
* instancePort: 443,
* policyNames: [wu_tang_root_ca_backend_auth_policy.policyName],
* });
* ```
*/
class LoadBalancerBackendServerPolicy extends pulumi.CustomResource {
/**
* Get an existing LoadBalancerBackendServerPolicy 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 LoadBalancerBackendServerPolicy(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of LoadBalancerBackendServerPolicy. 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'] === LoadBalancerBackendServerPolicy.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["instancePort"] = state?.instancePort;
resourceInputs["loadBalancerName"] = state?.loadBalancerName;
resourceInputs["policyNames"] = state?.policyNames;
resourceInputs["region"] = state?.region;
}
else {
const args = argsOrState;
if (args?.instancePort === undefined && !opts.urn) {
throw new Error("Missing required property 'instancePort'");
}
if (args?.loadBalancerName === undefined && !opts.urn) {
throw new Error("Missing required property 'loadBalancerName'");
}
resourceInputs["instancePort"] = args?.instancePort;
resourceInputs["loadBalancerName"] = args?.loadBalancerName;
resourceInputs["policyNames"] = args?.policyNames;
resourceInputs["region"] = args?.region;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const aliasOpts = { aliases: [{ type: "aws:elasticloadbalancing/loadBalancerBackendServerPolicy:LoadBalancerBackendServerPolicy" }] };
opts = pulumi.mergeOptions(opts, aliasOpts);
super(LoadBalancerBackendServerPolicy.__pulumiType, name, resourceInputs, opts);
}
}
exports.LoadBalancerBackendServerPolicy = LoadBalancerBackendServerPolicy;
/** @internal */
LoadBalancerBackendServerPolicy.__pulumiType = 'aws:elb/loadBalancerBackendServerPolicy:LoadBalancerBackendServerPolicy';
//# sourceMappingURL=loadBalancerBackendServerPolicy.js.map