1. Packages
  2. Harness Provider
  3. API Docs
  4. autostopping
  5. AwsAlb
Harness v0.7.1 published on Saturday, Mar 29, 2025 by Pulumi

harness.autostopping.AwsAlb

Explore with Pulumi AI

Resource for creating an AWS application load balancer

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as harness from "@pulumi/harness";

const test = new harness.autostopping.AwsAlb("test", {
    name: "name",
    cloudConnectorId: "cloud_connector_id",
    hostName: "host_name",
    region: "region",
    vpc: "vpc",
    securityGroups: [
        "sg1",
        "sg2",
    ],
    route53HostedZoneId: "/hostedzone/zone_id",
    deleteCloudResourcesOnDestroy: true,
});
const harnessAlb = new harness.autostopping.AwsAlb("harness_alb", {
    name: "harness_alb",
    cloudConnectorId: "cloud_connector_id",
    hostName: "host.name",
    albArn: "arn:aws:elasticloadbalancing:region:aws_account_id:loadbalancer/app/harness_alb/id",
    region: "region",
    vpc: "vpc",
    securityGroups: ["sg-0"],
    route53HostedZoneId: "/hostedzone/zone_id",
    deleteCloudResourcesOnDestroy: false,
});
Copy
import pulumi
import pulumi_harness as harness

test = harness.autostopping.AwsAlb("test",
    name="name",
    cloud_connector_id="cloud_connector_id",
    host_name="host_name",
    region="region",
    vpc="vpc",
    security_groups=[
        "sg1",
        "sg2",
    ],
    route53_hosted_zone_id="/hostedzone/zone_id",
    delete_cloud_resources_on_destroy=True)
harness_alb = harness.autostopping.AwsAlb("harness_alb",
    name="harness_alb",
    cloud_connector_id="cloud_connector_id",
    host_name="host.name",
    alb_arn="arn:aws:elasticloadbalancing:region:aws_account_id:loadbalancer/app/harness_alb/id",
    region="region",
    vpc="vpc",
    security_groups=["sg-0"],
    route53_hosted_zone_id="/hostedzone/zone_id",
    delete_cloud_resources_on_destroy=False)
Copy
package main

import (
	"github.com/pulumi/pulumi-harness/sdk/go/harness/autostopping"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := autostopping.NewAwsAlb(ctx, "test", &autostopping.AwsAlbArgs{
			Name:             pulumi.String("name"),
			CloudConnectorId: pulumi.String("cloud_connector_id"),
			HostName:         pulumi.String("host_name"),
			Region:           pulumi.String("region"),
			Vpc:              pulumi.String("vpc"),
			SecurityGroups: pulumi.StringArray{
				pulumi.String("sg1"),
				pulumi.String("sg2"),
			},
			Route53HostedZoneId:           pulumi.String("/hostedzone/zone_id"),
			DeleteCloudResourcesOnDestroy: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		_, err = autostopping.NewAwsAlb(ctx, "harness_alb", &autostopping.AwsAlbArgs{
			Name:             pulumi.String("harness_alb"),
			CloudConnectorId: pulumi.String("cloud_connector_id"),
			HostName:         pulumi.String("host.name"),
			AlbArn:           pulumi.String("arn:aws:elasticloadbalancing:region:aws_account_id:loadbalancer/app/harness_alb/id"),
			Region:           pulumi.String("region"),
			Vpc:              pulumi.String("vpc"),
			SecurityGroups: pulumi.StringArray{
				pulumi.String("sg-0"),
			},
			Route53HostedZoneId:           pulumi.String("/hostedzone/zone_id"),
			DeleteCloudResourcesOnDestroy: pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Harness = Pulumi.Harness;

return await Deployment.RunAsync(() => 
{
    var test = new Harness.Autostopping.AwsAlb("test", new()
    {
        Name = "name",
        CloudConnectorId = "cloud_connector_id",
        HostName = "host_name",
        Region = "region",
        Vpc = "vpc",
        SecurityGroups = new[]
        {
            "sg1",
            "sg2",
        },
        Route53HostedZoneId = "/hostedzone/zone_id",
        DeleteCloudResourcesOnDestroy = true,
    });

    var harnessAlb = new Harness.Autostopping.AwsAlb("harness_alb", new()
    {
        Name = "harness_alb",
        CloudConnectorId = "cloud_connector_id",
        HostName = "host.name",
        AlbArn = "arn:aws:elasticloadbalancing:region:aws_account_id:loadbalancer/app/harness_alb/id",
        Region = "region",
        Vpc = "vpc",
        SecurityGroups = new[]
        {
            "sg-0",
        },
        Route53HostedZoneId = "/hostedzone/zone_id",
        DeleteCloudResourcesOnDestroy = false,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.harness.autostopping.AwsAlb;
import com.pulumi.harness.autostopping.AwsAlbArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var test = new AwsAlb("test", AwsAlbArgs.builder()
            .name("name")
            .cloudConnectorId("cloud_connector_id")
            .hostName("host_name")
            .region("region")
            .vpc("vpc")
            .securityGroups(            
                "sg1",
                "sg2")
            .route53HostedZoneId("/hostedzone/zone_id")
            .deleteCloudResourcesOnDestroy(true)
            .build());

        var harnessAlb = new AwsAlb("harnessAlb", AwsAlbArgs.builder()
            .name("harness_alb")
            .cloudConnectorId("cloud_connector_id")
            .hostName("host.name")
            .albArn("arn:aws:elasticloadbalancing:region:aws_account_id:loadbalancer/app/harness_alb/id")
            .region("region")
            .vpc("vpc")
            .securityGroups("sg-0")
            .route53HostedZoneId("/hostedzone/zone_id")
            .deleteCloudResourcesOnDestroy(false)
            .build());

    }
}
Copy
resources:
  test:
    type: harness:autostopping:AwsAlb
    properties:
      name: name
      cloudConnectorId: cloud_connector_id
      hostName: host_name
      region: region
      vpc: vpc
      securityGroups:
        - sg1
        - sg2
      route53HostedZoneId: /hostedzone/zone_id
      deleteCloudResourcesOnDestroy: true
  harnessAlb:
    type: harness:autostopping:AwsAlb
    name: harness_alb
    properties:
      name: harness_alb
      cloudConnectorId: cloud_connector_id
      hostName: host.name
      albArn: arn:aws:elasticloadbalancing:region:aws_account_id:loadbalancer/app/harness_alb/id
      region: region
      vpc: vpc
      securityGroups:
        - sg-0
      route53HostedZoneId: /hostedzone/zone_id
      deleteCloudResourcesOnDestroy: false
Copy

Create AwsAlb Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new AwsAlb(name: string, args: AwsAlbArgs, opts?: CustomResourceOptions);
@overload
def AwsAlb(resource_name: str,
           args: AwsAlbArgs,
           opts: Optional[ResourceOptions] = None)

@overload
def AwsAlb(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           cloud_connector_id: Optional[str] = None,
           delete_cloud_resources_on_destroy: Optional[bool] = None,
           host_name: Optional[str] = None,
           region: Optional[str] = None,
           vpc: Optional[str] = None,
           alb_arn: Optional[str] = None,
           certificate_id: Optional[str] = None,
           name: Optional[str] = None,
           route53_hosted_zone_id: Optional[str] = None,
           security_groups: Optional[Sequence[str]] = None)
func NewAwsAlb(ctx *Context, name string, args AwsAlbArgs, opts ...ResourceOption) (*AwsAlb, error)
public AwsAlb(string name, AwsAlbArgs args, CustomResourceOptions? opts = null)
public AwsAlb(String name, AwsAlbArgs args)
public AwsAlb(String name, AwsAlbArgs args, CustomResourceOptions options)
type: harness:autostopping:AwsAlb
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. AwsAlbArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. AwsAlbArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. AwsAlbArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. AwsAlbArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. AwsAlbArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var awsAlbResource = new Harness.Autostopping.AwsAlb("awsAlbResource", new()
{
    CloudConnectorId = "string",
    DeleteCloudResourcesOnDestroy = false,
    HostName = "string",
    Region = "string",
    Vpc = "string",
    AlbArn = "string",
    CertificateId = "string",
    Name = "string",
    Route53HostedZoneId = "string",
    SecurityGroups = new[]
    {
        "string",
    },
});
Copy
example, err := autostopping.NewAwsAlb(ctx, "awsAlbResource", &autostopping.AwsAlbArgs{
	CloudConnectorId:              pulumi.String("string"),
	DeleteCloudResourcesOnDestroy: pulumi.Bool(false),
	HostName:                      pulumi.String("string"),
	Region:                        pulumi.String("string"),
	Vpc:                           pulumi.String("string"),
	AlbArn:                        pulumi.String("string"),
	CertificateId:                 pulumi.String("string"),
	Name:                          pulumi.String("string"),
	Route53HostedZoneId:           pulumi.String("string"),
	SecurityGroups: pulumi.StringArray{
		pulumi.String("string"),
	},
})
Copy
var awsAlbResource = new AwsAlb("awsAlbResource", AwsAlbArgs.builder()
    .cloudConnectorId("string")
    .deleteCloudResourcesOnDestroy(false)
    .hostName("string")
    .region("string")
    .vpc("string")
    .albArn("string")
    .certificateId("string")
    .name("string")
    .route53HostedZoneId("string")
    .securityGroups("string")
    .build());
Copy
aws_alb_resource = harness.autostopping.AwsAlb("awsAlbResource",
    cloud_connector_id="string",
    delete_cloud_resources_on_destroy=False,
    host_name="string",
    region="string",
    vpc="string",
    alb_arn="string",
    certificate_id="string",
    name="string",
    route53_hosted_zone_id="string",
    security_groups=["string"])
Copy
const awsAlbResource = new harness.autostopping.AwsAlb("awsAlbResource", {
    cloudConnectorId: "string",
    deleteCloudResourcesOnDestroy: false,
    hostName: "string",
    region: "string",
    vpc: "string",
    albArn: "string",
    certificateId: "string",
    name: "string",
    route53HostedZoneId: "string",
    securityGroups: ["string"],
});
Copy
type: harness:autostopping:AwsAlb
properties:
    albArn: string
    certificateId: string
    cloudConnectorId: string
    deleteCloudResourcesOnDestroy: false
    hostName: string
    name: string
    region: string
    route53HostedZoneId: string
    securityGroups:
        - string
    vpc: string
Copy

AwsAlb Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The AwsAlb resource accepts the following input properties:

CloudConnectorId This property is required. string
Id of the cloud connector
DeleteCloudResourcesOnDestroy This property is required. bool
HostName This property is required. string
Hostname for the proxy
Region This property is required. string
Region in which cloud resources are hosted
Vpc This property is required. string
VPC in which cloud resources are hosted
AlbArn string
Arn of AWS ALB to be imported. Required only for importing existing ALB
CertificateId string
Name string
Name of the proxy
Route53HostedZoneId string
Route 53 hosted zone id
SecurityGroups List<string>
Security Group to define the security rules that determine the inbound and outbound traffic
CloudConnectorId This property is required. string
Id of the cloud connector
DeleteCloudResourcesOnDestroy This property is required. bool
HostName This property is required. string
Hostname for the proxy
Region This property is required. string
Region in which cloud resources are hosted
Vpc This property is required. string
VPC in which cloud resources are hosted
AlbArn string
Arn of AWS ALB to be imported. Required only for importing existing ALB
CertificateId string
Name string
Name of the proxy
Route53HostedZoneId string
Route 53 hosted zone id
SecurityGroups []string
Security Group to define the security rules that determine the inbound and outbound traffic
cloudConnectorId This property is required. String
Id of the cloud connector
deleteCloudResourcesOnDestroy This property is required. Boolean
hostName This property is required. String
Hostname for the proxy
region This property is required. String
Region in which cloud resources are hosted
vpc This property is required. String
VPC in which cloud resources are hosted
albArn String
Arn of AWS ALB to be imported. Required only for importing existing ALB
certificateId String
name String
Name of the proxy
route53HostedZoneId String
Route 53 hosted zone id
securityGroups List<String>
Security Group to define the security rules that determine the inbound and outbound traffic
cloudConnectorId This property is required. string
Id of the cloud connector
deleteCloudResourcesOnDestroy This property is required. boolean
hostName This property is required. string
Hostname for the proxy
region This property is required. string
Region in which cloud resources are hosted
vpc This property is required. string
VPC in which cloud resources are hosted
albArn string
Arn of AWS ALB to be imported. Required only for importing existing ALB
certificateId string
name string
Name of the proxy
route53HostedZoneId string
Route 53 hosted zone id
securityGroups string[]
Security Group to define the security rules that determine the inbound and outbound traffic
cloud_connector_id This property is required. str
Id of the cloud connector
delete_cloud_resources_on_destroy This property is required. bool
host_name This property is required. str
Hostname for the proxy
region This property is required. str
Region in which cloud resources are hosted
vpc This property is required. str
VPC in which cloud resources are hosted
alb_arn str
Arn of AWS ALB to be imported. Required only for importing existing ALB
certificate_id str
name str
Name of the proxy
route53_hosted_zone_id str
Route 53 hosted zone id
security_groups Sequence[str]
Security Group to define the security rules that determine the inbound and outbound traffic
cloudConnectorId This property is required. String
Id of the cloud connector
deleteCloudResourcesOnDestroy This property is required. Boolean
hostName This property is required. String
Hostname for the proxy
region This property is required. String
Region in which cloud resources are hosted
vpc This property is required. String
VPC in which cloud resources are hosted
albArn String
Arn of AWS ALB to be imported. Required only for importing existing ALB
certificateId String
name String
Name of the proxy
route53HostedZoneId String
Route 53 hosted zone id
securityGroups List<String>
Security Group to define the security rules that determine the inbound and outbound traffic

Outputs

All input properties are implicitly available as output properties. Additionally, the AwsAlb resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Identifier string
Unique identifier of the resource
Id string
The provider-assigned unique ID for this managed resource.
Identifier string
Unique identifier of the resource
id String
The provider-assigned unique ID for this managed resource.
identifier String
Unique identifier of the resource
id string
The provider-assigned unique ID for this managed resource.
identifier string
Unique identifier of the resource
id str
The provider-assigned unique ID for this managed resource.
identifier str
Unique identifier of the resource
id String
The provider-assigned unique ID for this managed resource.
identifier String
Unique identifier of the resource

Look up Existing AwsAlb Resource

Get an existing AwsAlb resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: AwsAlbState, opts?: CustomResourceOptions): AwsAlb
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        alb_arn: Optional[str] = None,
        certificate_id: Optional[str] = None,
        cloud_connector_id: Optional[str] = None,
        delete_cloud_resources_on_destroy: Optional[bool] = None,
        host_name: Optional[str] = None,
        identifier: Optional[str] = None,
        name: Optional[str] = None,
        region: Optional[str] = None,
        route53_hosted_zone_id: Optional[str] = None,
        security_groups: Optional[Sequence[str]] = None,
        vpc: Optional[str] = None) -> AwsAlb
func GetAwsAlb(ctx *Context, name string, id IDInput, state *AwsAlbState, opts ...ResourceOption) (*AwsAlb, error)
public static AwsAlb Get(string name, Input<string> id, AwsAlbState? state, CustomResourceOptions? opts = null)
public static AwsAlb get(String name, Output<String> id, AwsAlbState state, CustomResourceOptions options)
resources:  _:    type: harness:autostopping:AwsAlb    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AlbArn string
Arn of AWS ALB to be imported. Required only for importing existing ALB
CertificateId string
CloudConnectorId string
Id of the cloud connector
DeleteCloudResourcesOnDestroy bool
HostName string
Hostname for the proxy
Identifier string
Unique identifier of the resource
Name string
Name of the proxy
Region string
Region in which cloud resources are hosted
Route53HostedZoneId string
Route 53 hosted zone id
SecurityGroups List<string>
Security Group to define the security rules that determine the inbound and outbound traffic
Vpc string
VPC in which cloud resources are hosted
AlbArn string
Arn of AWS ALB to be imported. Required only for importing existing ALB
CertificateId string
CloudConnectorId string
Id of the cloud connector
DeleteCloudResourcesOnDestroy bool
HostName string
Hostname for the proxy
Identifier string
Unique identifier of the resource
Name string
Name of the proxy
Region string
Region in which cloud resources are hosted
Route53HostedZoneId string
Route 53 hosted zone id
SecurityGroups []string
Security Group to define the security rules that determine the inbound and outbound traffic
Vpc string
VPC in which cloud resources are hosted
albArn String
Arn of AWS ALB to be imported. Required only for importing existing ALB
certificateId String
cloudConnectorId String
Id of the cloud connector
deleteCloudResourcesOnDestroy Boolean
hostName String
Hostname for the proxy
identifier String
Unique identifier of the resource
name String
Name of the proxy
region String
Region in which cloud resources are hosted
route53HostedZoneId String
Route 53 hosted zone id
securityGroups List<String>
Security Group to define the security rules that determine the inbound and outbound traffic
vpc String
VPC in which cloud resources are hosted
albArn string
Arn of AWS ALB to be imported. Required only for importing existing ALB
certificateId string
cloudConnectorId string
Id of the cloud connector
deleteCloudResourcesOnDestroy boolean
hostName string
Hostname for the proxy
identifier string
Unique identifier of the resource
name string
Name of the proxy
region string
Region in which cloud resources are hosted
route53HostedZoneId string
Route 53 hosted zone id
securityGroups string[]
Security Group to define the security rules that determine the inbound and outbound traffic
vpc string
VPC in which cloud resources are hosted
alb_arn str
Arn of AWS ALB to be imported. Required only for importing existing ALB
certificate_id str
cloud_connector_id str
Id of the cloud connector
delete_cloud_resources_on_destroy bool
host_name str
Hostname for the proxy
identifier str
Unique identifier of the resource
name str
Name of the proxy
region str
Region in which cloud resources are hosted
route53_hosted_zone_id str
Route 53 hosted zone id
security_groups Sequence[str]
Security Group to define the security rules that determine the inbound and outbound traffic
vpc str
VPC in which cloud resources are hosted
albArn String
Arn of AWS ALB to be imported. Required only for importing existing ALB
certificateId String
cloudConnectorId String
Id of the cloud connector
deleteCloudResourcesOnDestroy Boolean
hostName String
Hostname for the proxy
identifier String
Unique identifier of the resource
name String
Name of the proxy
region String
Region in which cloud resources are hosted
route53HostedZoneId String
Route 53 hosted zone id
securityGroups List<String>
Security Group to define the security rules that determine the inbound and outbound traffic
vpc String
VPC in which cloud resources are hosted

Package Details

Repository
harness pulumi/pulumi-harness
License
Apache-2.0
Notes
This Pulumi package is based on the harness Terraform Provider.