1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. edas
  5. K8sSlbAttachment
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.edas.K8sSlbAttachment

Explore with Pulumi AI

Binds SLBs to an EDAS k8s application.

For information about EDAS k8s slb attachment and how to use it, see What is k8s slb attachment.

NOTE: Available since v1.194.0.

Create K8sSlbAttachment Resource

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

Constructor syntax

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

@overload
def K8sSlbAttachment(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     app_id: Optional[str] = None,
                     slb_configs: Optional[Sequence[K8sSlbAttachmentSlbConfigArgs]] = None)
func NewK8sSlbAttachment(ctx *Context, name string, args K8sSlbAttachmentArgs, opts ...ResourceOption) (*K8sSlbAttachment, error)
public K8sSlbAttachment(string name, K8sSlbAttachmentArgs args, CustomResourceOptions? opts = null)
public K8sSlbAttachment(String name, K8sSlbAttachmentArgs args)
public K8sSlbAttachment(String name, K8sSlbAttachmentArgs args, CustomResourceOptions options)
type: alicloud:edas:K8sSlbAttachment
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. K8sSlbAttachmentArgs
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. K8sSlbAttachmentArgs
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. K8sSlbAttachmentArgs
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. K8sSlbAttachmentArgs
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. K8sSlbAttachmentArgs
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 k8sSlbAttachmentResource = new AliCloud.Edas.K8sSlbAttachment("k8sSlbAttachmentResource", new()
{
    AppId = "string",
    SlbConfigs = new[]
    {
        new AliCloud.Edas.Inputs.K8sSlbAttachmentSlbConfigArgs
        {
            PortMappings = new[]
            {
                new AliCloud.Edas.Inputs.K8sSlbAttachmentSlbConfigPortMappingArgs
                {
                    LoadbalancerProtocol = "string",
                    ServicePort = new AliCloud.Edas.Inputs.K8sSlbAttachmentSlbConfigPortMappingServicePortArgs
                    {
                        Port = 0,
                        Protocol = "string",
                        TargetPort = 0,
                    },
                    CertId = "string",
                },
            },
            Scheduler = "string",
            Type = "string",
            Name = "string",
            SlbId = "string",
            Specification = "string",
        },
    },
});
Copy
example, err := edas.NewK8sSlbAttachment(ctx, "k8sSlbAttachmentResource", &edas.K8sSlbAttachmentArgs{
	AppId: pulumi.String("string"),
	SlbConfigs: edas.K8sSlbAttachmentSlbConfigArray{
		&edas.K8sSlbAttachmentSlbConfigArgs{
			PortMappings: edas.K8sSlbAttachmentSlbConfigPortMappingArray{
				&edas.K8sSlbAttachmentSlbConfigPortMappingArgs{
					LoadbalancerProtocol: pulumi.String("string"),
					ServicePort: &edas.K8sSlbAttachmentSlbConfigPortMappingServicePortArgs{
						Port:       pulumi.Int(0),
						Protocol:   pulumi.String("string"),
						TargetPort: pulumi.Int(0),
					},
					CertId: pulumi.String("string"),
				},
			},
			Scheduler:     pulumi.String("string"),
			Type:          pulumi.String("string"),
			Name:          pulumi.String("string"),
			SlbId:         pulumi.String("string"),
			Specification: pulumi.String("string"),
		},
	},
})
Copy
var k8sSlbAttachmentResource = new K8sSlbAttachment("k8sSlbAttachmentResource", K8sSlbAttachmentArgs.builder()
    .appId("string")
    .slbConfigs(K8sSlbAttachmentSlbConfigArgs.builder()
        .portMappings(K8sSlbAttachmentSlbConfigPortMappingArgs.builder()
            .loadbalancerProtocol("string")
            .servicePort(K8sSlbAttachmentSlbConfigPortMappingServicePortArgs.builder()
                .port(0)
                .protocol("string")
                .targetPort(0)
                .build())
            .certId("string")
            .build())
        .scheduler("string")
        .type("string")
        .name("string")
        .slbId("string")
        .specification("string")
        .build())
    .build());
Copy
k8s_slb_attachment_resource = alicloud.edas.K8sSlbAttachment("k8sSlbAttachmentResource",
    app_id="string",
    slb_configs=[{
        "port_mappings": [{
            "loadbalancer_protocol": "string",
            "service_port": {
                "port": 0,
                "protocol": "string",
                "target_port": 0,
            },
            "cert_id": "string",
        }],
        "scheduler": "string",
        "type": "string",
        "name": "string",
        "slb_id": "string",
        "specification": "string",
    }])
Copy
const k8sSlbAttachmentResource = new alicloud.edas.K8sSlbAttachment("k8sSlbAttachmentResource", {
    appId: "string",
    slbConfigs: [{
        portMappings: [{
            loadbalancerProtocol: "string",
            servicePort: {
                port: 0,
                protocol: "string",
                targetPort: 0,
            },
            certId: "string",
        }],
        scheduler: "string",
        type: "string",
        name: "string",
        slbId: "string",
        specification: "string",
    }],
});
Copy
type: alicloud:edas:K8sSlbAttachment
properties:
    appId: string
    slbConfigs:
        - name: string
          portMappings:
            - certId: string
              loadbalancerProtocol: string
              servicePort:
                port: 0
                protocol: string
                targetPort: 0
          scheduler: string
          slbId: string
          specification: string
          type: string
Copy

K8sSlbAttachment 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 K8sSlbAttachment resource accepts the following input properties:

AppId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the EDAS k8s application to which you want to bind SLB instances.
SlbConfigs List<Pulumi.AliCloud.Edas.Inputs.K8sSlbAttachmentSlbConfig>
The configurations of SLB attachment, which is supported for multiple configurations. See slb_configs below.
AppId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the EDAS k8s application to which you want to bind SLB instances.
SlbConfigs []K8sSlbAttachmentSlbConfigArgs
The configurations of SLB attachment, which is supported for multiple configurations. See slb_configs below.
appId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the EDAS k8s application to which you want to bind SLB instances.
slbConfigs List<K8sSlbAttachmentSlbConfig>
The configurations of SLB attachment, which is supported for multiple configurations. See slb_configs below.
appId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the EDAS k8s application to which you want to bind SLB instances.
slbConfigs K8sSlbAttachmentSlbConfig[]
The configurations of SLB attachment, which is supported for multiple configurations. See slb_configs below.
app_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the EDAS k8s application to which you want to bind SLB instances.
slb_configs Sequence[K8sSlbAttachmentSlbConfigArgs]
The configurations of SLB attachment, which is supported for multiple configurations. See slb_configs below.
appId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the EDAS k8s application to which you want to bind SLB instances.
slbConfigs List<Property Map>
The configurations of SLB attachment, which is supported for multiple configurations. See slb_configs below.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing K8sSlbAttachment Resource

Get an existing K8sSlbAttachment 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?: K8sSlbAttachmentState, opts?: CustomResourceOptions): K8sSlbAttachment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        app_id: Optional[str] = None,
        slb_configs: Optional[Sequence[K8sSlbAttachmentSlbConfigArgs]] = None) -> K8sSlbAttachment
func GetK8sSlbAttachment(ctx *Context, name string, id IDInput, state *K8sSlbAttachmentState, opts ...ResourceOption) (*K8sSlbAttachment, error)
public static K8sSlbAttachment Get(string name, Input<string> id, K8sSlbAttachmentState? state, CustomResourceOptions? opts = null)
public static K8sSlbAttachment get(String name, Output<String> id, K8sSlbAttachmentState state, CustomResourceOptions options)
resources:  _:    type: alicloud:edas:K8sSlbAttachment    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:
AppId Changes to this property will trigger replacement. string
The ID of the EDAS k8s application to which you want to bind SLB instances.
SlbConfigs List<Pulumi.AliCloud.Edas.Inputs.K8sSlbAttachmentSlbConfig>
The configurations of SLB attachment, which is supported for multiple configurations. See slb_configs below.
AppId Changes to this property will trigger replacement. string
The ID of the EDAS k8s application to which you want to bind SLB instances.
SlbConfigs []K8sSlbAttachmentSlbConfigArgs
The configurations of SLB attachment, which is supported for multiple configurations. See slb_configs below.
appId Changes to this property will trigger replacement. String
The ID of the EDAS k8s application to which you want to bind SLB instances.
slbConfigs List<K8sSlbAttachmentSlbConfig>
The configurations of SLB attachment, which is supported for multiple configurations. See slb_configs below.
appId Changes to this property will trigger replacement. string
The ID of the EDAS k8s application to which you want to bind SLB instances.
slbConfigs K8sSlbAttachmentSlbConfig[]
The configurations of SLB attachment, which is supported for multiple configurations. See slb_configs below.
app_id Changes to this property will trigger replacement. str
The ID of the EDAS k8s application to which you want to bind SLB instances.
slb_configs Sequence[K8sSlbAttachmentSlbConfigArgs]
The configurations of SLB attachment, which is supported for multiple configurations. See slb_configs below.
appId Changes to this property will trigger replacement. String
The ID of the EDAS k8s application to which you want to bind SLB instances.
slbConfigs List<Property Map>
The configurations of SLB attachment, which is supported for multiple configurations. See slb_configs below.

Supporting Types

K8sSlbAttachmentSlbConfig
, K8sSlbAttachmentSlbConfigArgs

PortMappings This property is required. List<Pulumi.AliCloud.Edas.Inputs.K8sSlbAttachmentSlbConfigPortMapping>
The port configuration for SLB instance, which is supported for multiple configurations. See port_mappings below.
Scheduler This property is required. string
The scheduler policy of SLB configuration, values can be 'rr'(round-robin) or 'wrr'(weighted round-robin).
Type This property is required. string
The type of SLB instance, values can be 'internet' or 'intranet'.
Name string
The name of this SLB configuration, empty for auto-generated by EDAS server.
SlbId string
The ID of your SLB instance, if value is empty which means EDAS will purchase an SLB instance with 'specification' field.
Specification string
The instance specification of SLB, values can be found here, empty for 'slb.s1.small'.
PortMappings This property is required. []K8sSlbAttachmentSlbConfigPortMapping
The port configuration for SLB instance, which is supported for multiple configurations. See port_mappings below.
Scheduler This property is required. string
The scheduler policy of SLB configuration, values can be 'rr'(round-robin) or 'wrr'(weighted round-robin).
Type This property is required. string
The type of SLB instance, values can be 'internet' or 'intranet'.
Name string
The name of this SLB configuration, empty for auto-generated by EDAS server.
SlbId string
The ID of your SLB instance, if value is empty which means EDAS will purchase an SLB instance with 'specification' field.
Specification string
The instance specification of SLB, values can be found here, empty for 'slb.s1.small'.
portMappings This property is required. List<K8sSlbAttachmentSlbConfigPortMapping>
The port configuration for SLB instance, which is supported for multiple configurations. See port_mappings below.
scheduler This property is required. String
The scheduler policy of SLB configuration, values can be 'rr'(round-robin) or 'wrr'(weighted round-robin).
type This property is required. String
The type of SLB instance, values can be 'internet' or 'intranet'.
name String
The name of this SLB configuration, empty for auto-generated by EDAS server.
slbId String
The ID of your SLB instance, if value is empty which means EDAS will purchase an SLB instance with 'specification' field.
specification String
The instance specification of SLB, values can be found here, empty for 'slb.s1.small'.
portMappings This property is required. K8sSlbAttachmentSlbConfigPortMapping[]
The port configuration for SLB instance, which is supported for multiple configurations. See port_mappings below.
scheduler This property is required. string
The scheduler policy of SLB configuration, values can be 'rr'(round-robin) or 'wrr'(weighted round-robin).
type This property is required. string
The type of SLB instance, values can be 'internet' or 'intranet'.
name string
The name of this SLB configuration, empty for auto-generated by EDAS server.
slbId string
The ID of your SLB instance, if value is empty which means EDAS will purchase an SLB instance with 'specification' field.
specification string
The instance specification of SLB, values can be found here, empty for 'slb.s1.small'.
port_mappings This property is required. Sequence[K8sSlbAttachmentSlbConfigPortMapping]
The port configuration for SLB instance, which is supported for multiple configurations. See port_mappings below.
scheduler This property is required. str
The scheduler policy of SLB configuration, values can be 'rr'(round-robin) or 'wrr'(weighted round-robin).
type This property is required. str
The type of SLB instance, values can be 'internet' or 'intranet'.
name str
The name of this SLB configuration, empty for auto-generated by EDAS server.
slb_id str
The ID of your SLB instance, if value is empty which means EDAS will purchase an SLB instance with 'specification' field.
specification str
The instance specification of SLB, values can be found here, empty for 'slb.s1.small'.
portMappings This property is required. List<Property Map>
The port configuration for SLB instance, which is supported for multiple configurations. See port_mappings below.
scheduler This property is required. String
The scheduler policy of SLB configuration, values can be 'rr'(round-robin) or 'wrr'(weighted round-robin).
type This property is required. String
The type of SLB instance, values can be 'internet' or 'intranet'.
name String
The name of this SLB configuration, empty for auto-generated by EDAS server.
slbId String
The ID of your SLB instance, if value is empty which means EDAS will purchase an SLB instance with 'specification' field.
specification String
The instance specification of SLB, values can be found here, empty for 'slb.s1.small'.

K8sSlbAttachmentSlbConfigPortMapping
, K8sSlbAttachmentSlbConfigPortMappingArgs

LoadbalancerProtocol This property is required. string
The protocol of SLB instance configuration, values can be 'TCP', 'HTTP' or 'HTTPS'.
ServicePort This property is required. Pulumi.AliCloud.Edas.Inputs.K8sSlbAttachmentSlbConfigPortMappingServicePort
The backend k8s service configuration for SLB instance, which is supported for multiple configurations. See service_port below.
CertId string
The ID of your tls certification, this is used for 'HTTPS' protocol only.
LoadbalancerProtocol This property is required. string
The protocol of SLB instance configuration, values can be 'TCP', 'HTTP' or 'HTTPS'.
ServicePort This property is required. K8sSlbAttachmentSlbConfigPortMappingServicePort
The backend k8s service configuration for SLB instance, which is supported for multiple configurations. See service_port below.
CertId string
The ID of your tls certification, this is used for 'HTTPS' protocol only.
loadbalancerProtocol This property is required. String
The protocol of SLB instance configuration, values can be 'TCP', 'HTTP' or 'HTTPS'.
servicePort This property is required. K8sSlbAttachmentSlbConfigPortMappingServicePort
The backend k8s service configuration for SLB instance, which is supported for multiple configurations. See service_port below.
certId String
The ID of your tls certification, this is used for 'HTTPS' protocol only.
loadbalancerProtocol This property is required. string
The protocol of SLB instance configuration, values can be 'TCP', 'HTTP' or 'HTTPS'.
servicePort This property is required. K8sSlbAttachmentSlbConfigPortMappingServicePort
The backend k8s service configuration for SLB instance, which is supported for multiple configurations. See service_port below.
certId string
The ID of your tls certification, this is used for 'HTTPS' protocol only.
loadbalancer_protocol This property is required. str
The protocol of SLB instance configuration, values can be 'TCP', 'HTTP' or 'HTTPS'.
service_port This property is required. K8sSlbAttachmentSlbConfigPortMappingServicePort
The backend k8s service configuration for SLB instance, which is supported for multiple configurations. See service_port below.
cert_id str
The ID of your tls certification, this is used for 'HTTPS' protocol only.
loadbalancerProtocol This property is required. String
The protocol of SLB instance configuration, values can be 'TCP', 'HTTP' or 'HTTPS'.
servicePort This property is required. Property Map
The backend k8s service configuration for SLB instance, which is supported for multiple configurations. See service_port below.
certId String
The ID of your tls certification, this is used for 'HTTPS' protocol only.

K8sSlbAttachmentSlbConfigPortMappingServicePort
, K8sSlbAttachmentSlbConfigPortMappingServicePortArgs

Port This property is required. int
The port of k8s service, values should be within range [1, 65535].
Protocol This property is required. string
The protocol of k8s service, values can be 'TCP' or 'UDP'.
TargetPort This property is required. int
The port of k8s pod, values should be within range [1, 65535].
Port This property is required. int
The port of k8s service, values should be within range [1, 65535].
Protocol This property is required. string
The protocol of k8s service, values can be 'TCP' or 'UDP'.
TargetPort This property is required. int
The port of k8s pod, values should be within range [1, 65535].
port This property is required. Integer
The port of k8s service, values should be within range [1, 65535].
protocol This property is required. String
The protocol of k8s service, values can be 'TCP' or 'UDP'.
targetPort This property is required. Integer
The port of k8s pod, values should be within range [1, 65535].
port This property is required. number
The port of k8s service, values should be within range [1, 65535].
protocol This property is required. string
The protocol of k8s service, values can be 'TCP' or 'UDP'.
targetPort This property is required. number
The port of k8s pod, values should be within range [1, 65535].
port This property is required. int
The port of k8s service, values should be within range [1, 65535].
protocol This property is required. str
The protocol of k8s service, values can be 'TCP' or 'UDP'.
target_port This property is required. int
The port of k8s pod, values should be within range [1, 65535].
port This property is required. Number
The port of k8s service, values should be within range [1, 65535].
protocol This property is required. String
The protocol of k8s service, values can be 'TCP' or 'UDP'.
targetPort This property is required. Number
The port of k8s pod, values should be within range [1, 65535].

Import

Slb information of EDAS k8s application can be imported using the ID of an EDAS k8s application. e.g.

$ pulumi import alicloud:edas/k8sSlbAttachment:K8sSlbAttachment example <EDAS k8s app id>
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

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