K8s Slb Attachment
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 in v1.194.0+.
Example Usage
Basic Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.edas.K8sSlbAttachment;
import com.pulumi.alicloud.edas.K8sSlbAttachmentArgs;
import com.pulumi.alicloud.edas.inputs.K8sSlbAttachmentSlbConfigArgs;
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 example = new K8sSlbAttachment("example", K8sSlbAttachmentArgs.builder()
.appId("your_app_id")
.slbConfigs(
K8sSlbAttachmentSlbConfigArgs.builder()
.portMappings(K8sSlbAttachmentSlbConfigPortMappingArgs.builder()
.certId("your tls cert id")
.loadbalancerProtocol("TCP")
.servicePort(K8sSlbAttachmentSlbConfigPortMappingServicePortArgs.builder()
.port(80)
.protocol("TCP")
.targetPort(8080)
.build())
.build())
.scheduler("rr")
.slbId("your slb instance id")
.specification("slb.s1.small")
.type("internet")
.build(),
)
.build());
}
}
Content copied to clipboard
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>
Content copied to clipboard