@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
152 lines • 5.81 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.ListenerPolicy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Attaches a load balancer policy to an ELB Listener.
*
* ## Example Usage
*
* ### Custom Policy
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* 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_ssl = new aws.elb.LoadBalancerPolicy("wu-tang-ssl", {
* loadBalancerName: wu_tang.name,
* policyName: "wu-tang-ssl",
* policyTypeName: "SSLNegotiationPolicyType",
* policyAttributes: [
* {
* name: "ECDHE-ECDSA-AES128-GCM-SHA256",
* value: "true",
* },
* {
* name: "Protocol-TLSv1.2",
* value: "true",
* },
* ],
* });
* const wu_tang_listener_policies_443 = new aws.elb.ListenerPolicy("wu-tang-listener-policies-443", {
* loadBalancerName: wu_tang.name,
* loadBalancerPort: 443,
* policyNames: [wu_tang_ssl.policyName],
* });
* ```
*
* This example shows how to customize the TLS settings of an HTTPS listener.
*
* ### AWS Predefined Security Policy
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* 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_ssl_tls_1_1 = new aws.elb.LoadBalancerPolicy("wu-tang-ssl-tls-1-1", {
* loadBalancerName: wu_tang.name,
* policyName: "wu-tang-ssl",
* policyTypeName: "SSLNegotiationPolicyType",
* policyAttributes: [{
* name: "Reference-Security-Policy",
* value: "ELBSecurityPolicy-TLS-1-1-2017-01",
* }],
* });
* const wu_tang_listener_policies_443 = new aws.elb.ListenerPolicy("wu-tang-listener-policies-443", {
* loadBalancerName: wu_tang.name,
* loadBalancerPort: 443,
* policyNames: [wu_tang_ssl_tls_1_1.policyName],
* });
* ```
*
* This example shows how to add a [Predefined Security Policy for ELBs](https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-security-policy-table.html)
*/
class ListenerPolicy extends pulumi.CustomResource {
/**
* Get an existing ListenerPolicy 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 ListenerPolicy(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ListenerPolicy. 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'] === ListenerPolicy.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["loadBalancerName"] = state?.loadBalancerName;
resourceInputs["loadBalancerPort"] = state?.loadBalancerPort;
resourceInputs["policyNames"] = state?.policyNames;
resourceInputs["region"] = state?.region;
resourceInputs["triggers"] = state?.triggers;
}
else {
const args = argsOrState;
if (args?.loadBalancerName === undefined && !opts.urn) {
throw new Error("Missing required property 'loadBalancerName'");
}
if (args?.loadBalancerPort === undefined && !opts.urn) {
throw new Error("Missing required property 'loadBalancerPort'");
}
resourceInputs["loadBalancerName"] = args?.loadBalancerName;
resourceInputs["loadBalancerPort"] = args?.loadBalancerPort;
resourceInputs["policyNames"] = args?.policyNames;
resourceInputs["region"] = args?.region;
resourceInputs["triggers"] = args?.triggers;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const aliasOpts = { aliases: [{ type: "aws:elasticloadbalancing/listenerPolicy:ListenerPolicy" }] };
opts = pulumi.mergeOptions(opts, aliasOpts);
super(ListenerPolicy.__pulumiType, name, resourceInputs, opts);
}
}
exports.ListenerPolicy = ListenerPolicy;
/** @internal */
ListenerPolicy.__pulumiType = 'aws:elb/listenerPolicy:ListenerPolicy';
//# sourceMappingURL=listenerPolicy.js.map