1. Packages
  2. Ibm Provider
  3. API Docs
  4. getSatelliteAttachHostScript
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.getSatelliteAttachHostScript

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Retrieve information of an existing IBM Satellite location registration script as a data source. Creates a script to run on a Red Hat Enterprise Linux 7 or AWS EC2 host in your on-premises infrastructure. The script attaches the host to your IBM Cloud Satellite location. The host must have access to the public network in order for the script to complete. For more information, about setting up Satellite hosts, see Satellite hosts.

    Example Usage

    Sample to read satellite host script to attach IBM host to Satellite control plane

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const script = ibm.getSatelliteAttachHostScript({
        location: _var.location,
        labels: ["cpu:4"],
        hostProvider: "ibm",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    script = ibm.get_satellite_attach_host_script(location=var["location"],
        labels=["cpu:4"],
        host_provider="ibm")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.GetSatelliteAttachHostScript(ctx, &ibm.GetSatelliteAttachHostScriptArgs{
    			Location: _var.Location,
    			Labels: []string{
    				"cpu:4",
    			},
    			HostProvider: pulumi.StringRef("ibm"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var script = Ibm.GetSatelliteAttachHostScript.Invoke(new()
        {
            Location = @var.Location,
            Labels = new[]
            {
                "cpu:4",
            },
            HostProvider = "ibm",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IbmFunctions;
    import com.pulumi.ibm.inputs.GetSatelliteAttachHostScriptArgs;
    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) {
            final var script = IbmFunctions.getSatelliteAttachHostScript(GetSatelliteAttachHostScriptArgs.builder()
                .location(var_.location())
                .labels("cpu:4")
                .hostProvider("ibm")
                .build());
    
        }
    }
    
    variables:
      script:
        fn::invoke:
          function: ibm:getSatelliteAttachHostScript
          arguments:
            location: ${var.location}
            labels:
              - cpu:4
            hostProvider: ibm
    

    Sample to read satellite host script to attach AWS EC2 host to Satellite control plane and uses reduced firewall requirements.

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const script = ibm.getSatelliteAttachHostScript({
        location: _var.location,
        labels: _var.labels,
        scriptDir: "/tmp",
        hostProvider: "aws",
        hostLinkAgentEndpoint: "c-01-ws.us-south.link.satellite.cloud.ibm.com",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    script = ibm.get_satellite_attach_host_script(location=var["location"],
        labels=var["labels"],
        script_dir="/tmp",
        host_provider="aws",
        host_link_agent_endpoint="c-01-ws.us-south.link.satellite.cloud.ibm.com")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.GetSatelliteAttachHostScript(ctx, &ibm.GetSatelliteAttachHostScriptArgs{
    			Location:              _var.Location,
    			Labels:                _var.Labels,
    			ScriptDir:             pulumi.StringRef("/tmp"),
    			HostProvider:          pulumi.StringRef("aws"),
    			HostLinkAgentEndpoint: pulumi.StringRef("c-01-ws.us-south.link.satellite.cloud.ibm.com"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var script = Ibm.GetSatelliteAttachHostScript.Invoke(new()
        {
            Location = @var.Location,
            Labels = @var.Labels,
            ScriptDir = "/tmp",
            HostProvider = "aws",
            HostLinkAgentEndpoint = "c-01-ws.us-south.link.satellite.cloud.ibm.com",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IbmFunctions;
    import com.pulumi.ibm.inputs.GetSatelliteAttachHostScriptArgs;
    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) {
            final var script = IbmFunctions.getSatelliteAttachHostScript(GetSatelliteAttachHostScriptArgs.builder()
                .location(var_.location())
                .labels(var_.labels())
                .scriptDir("/tmp")
                .hostProvider("aws")
                .hostLinkAgentEndpoint("c-01-ws.us-south.link.satellite.cloud.ibm.com")
                .build());
    
        }
    }
    
    variables:
      script:
        fn::invoke:
          function: ibm:getSatelliteAttachHostScript
          arguments:
            location: ${var.location}
            labels: ${var.labels}
            scriptDir: /tmp
            hostProvider: aws
            hostLinkAgentEndpoint: c-01-ws.us-south.link.satellite.cloud.ibm.com
    

    Sample to read satellite host script to attach IBM host to Satellite control plane

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const script = ibm.getSatelliteAttachHostScript({
        location: _var.location,
        customScript: `subscription-manager refresh
    subscription-manager release --set=8
    subscription-manager repos --enable rhel-8-for-x86_64-baseos-rpms 
    subscription-manager repos --enable rhel-8-for-x86_64-appstream-rpms
    subscription-manager repos --disable='*eus*'
    yum install container-selinux -y
    `,
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    script = ibm.get_satellite_attach_host_script(location=var["location"],
        custom_script="""subscription-manager refresh
    subscription-manager release --set=8
    subscription-manager repos --enable rhel-8-for-x86_64-baseos-rpms 
    subscription-manager repos --enable rhel-8-for-x86_64-appstream-rpms
    subscription-manager repos --disable='*eus*'
    yum install container-selinux -y
    """)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.GetSatelliteAttachHostScript(ctx, &ibm.GetSatelliteAttachHostScriptArgs{
    			Location: _var.Location,
    			CustomScript: pulumi.StringRef(`subscription-manager refresh
    subscription-manager release --set=8
    subscription-manager repos --enable rhel-8-for-x86_64-baseos-rpms 
    subscription-manager repos --enable rhel-8-for-x86_64-appstream-rpms
    subscription-manager repos --disable='*eus*'
    yum install container-selinux -y
    `),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var script = Ibm.GetSatelliteAttachHostScript.Invoke(new()
        {
            Location = @var.Location,
            CustomScript = @"subscription-manager refresh
    subscription-manager release --set=8
    subscription-manager repos --enable rhel-8-for-x86_64-baseos-rpms 
    subscription-manager repos --enable rhel-8-for-x86_64-appstream-rpms
    subscription-manager repos --disable='*eus*'
    yum install container-selinux -y
    ",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IbmFunctions;
    import com.pulumi.ibm.inputs.GetSatelliteAttachHostScriptArgs;
    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) {
            final var script = IbmFunctions.getSatelliteAttachHostScript(GetSatelliteAttachHostScriptArgs.builder()
                .location(var_.location())
                .customScript("""
    subscription-manager refresh
    subscription-manager release --set=8
    subscription-manager repos --enable rhel-8-for-x86_64-baseos-rpms 
    subscription-manager repos --enable rhel-8-for-x86_64-appstream-rpms
    subscription-manager repos --disable='*eus*'
    yum install container-selinux -y
                """)
                .build());
    
        }
    }
    
    variables:
      script:
        fn::invoke:
          function: ibm:getSatelliteAttachHostScript
          arguments:
            location: ${var.location}
            customScript: "subscription-manager refresh\nsubscription-manager release --set=8\nsubscription-manager repos --enable rhel-8-for-x86_64-baseos-rpms \nsubscription-manager repos --enable rhel-8-for-x86_64-appstream-rpms\nsubscription-manager repos --disable='*eus*'\nyum install container-selinux -y\n"
    

    Attributes reference

    In addition to the argument reference list, you can access the following attribute reference after your resource is created.

    • id - The unique identifier of the location.
    • script_path - (String) Directory path to store the generated script.
    • host_script - (String) The raw content of the script file that was read.

    Using getSatelliteAttachHostScript

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getSatelliteAttachHostScript(args: GetSatelliteAttachHostScriptArgs, opts?: InvokeOptions): Promise<GetSatelliteAttachHostScriptResult>
    function getSatelliteAttachHostScriptOutput(args: GetSatelliteAttachHostScriptOutputArgs, opts?: InvokeOptions): Output<GetSatelliteAttachHostScriptResult>
    def get_satellite_attach_host_script(coreos_host: Optional[bool] = None,
                                         custom_script: Optional[str] = None,
                                         host_link_agent_endpoint: Optional[str] = None,
                                         host_provider: Optional[str] = None,
                                         id: Optional[str] = None,
                                         labels: Optional[Sequence[str]] = None,
                                         location: Optional[str] = None,
                                         script_dir: Optional[str] = None,
                                         opts: Optional[InvokeOptions] = None) -> GetSatelliteAttachHostScriptResult
    def get_satellite_attach_host_script_output(coreos_host: Optional[pulumi.Input[bool]] = None,
                                         custom_script: Optional[pulumi.Input[str]] = None,
                                         host_link_agent_endpoint: Optional[pulumi.Input[str]] = None,
                                         host_provider: Optional[pulumi.Input[str]] = None,
                                         id: Optional[pulumi.Input[str]] = None,
                                         labels: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                         location: Optional[pulumi.Input[str]] = None,
                                         script_dir: Optional[pulumi.Input[str]] = None,
                                         opts: Optional[InvokeOptions] = None) -> Output[GetSatelliteAttachHostScriptResult]
    func GetSatelliteAttachHostScript(ctx *Context, args *GetSatelliteAttachHostScriptArgs, opts ...InvokeOption) (*GetSatelliteAttachHostScriptResult, error)
    func GetSatelliteAttachHostScriptOutput(ctx *Context, args *GetSatelliteAttachHostScriptOutputArgs, opts ...InvokeOption) GetSatelliteAttachHostScriptResultOutput

    > Note: This function is named GetSatelliteAttachHostScript in the Go SDK.

    public static class GetSatelliteAttachHostScript 
    {
        public static Task<GetSatelliteAttachHostScriptResult> InvokeAsync(GetSatelliteAttachHostScriptArgs args, InvokeOptions? opts = null)
        public static Output<GetSatelliteAttachHostScriptResult> Invoke(GetSatelliteAttachHostScriptInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSatelliteAttachHostScriptResult> getSatelliteAttachHostScript(GetSatelliteAttachHostScriptArgs args, InvokeOptions options)
    public static Output<GetSatelliteAttachHostScriptResult> getSatelliteAttachHostScript(GetSatelliteAttachHostScriptArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ibm:index/getSatelliteAttachHostScript:getSatelliteAttachHostScript
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Location string
    The name or ID of the Satellite location.
    CoreosHost bool
    = (Optional, Bool) True if attaching a CoreOS host to a CoreOS-enabled location. Host attach script will be in ignition file format. If attaching a RHEL host to a location, then the value is false.
    CustomScript string
    RHEL hosts only. The custom script that has to be appended to generated host script file. Either custom_script or host_provider is required. This custom_script will be appended to the downloaded host attach script. Find custom scripts for respective cloud providers aws, google, azure, ibm.
    HostLinkAgentEndpoint string
    The endpoint that the link agent uses to connect to the link tunnel server. Required for reduced firewall support.
    HostProvider string
    The name of host provider, such as ibm, aws or azure.
    Id string
    Labels List<string>
    ) The set of key-value pairs to label the host, such as ["cpu:4"] to describe the host capabilities.
    ScriptDir string
    The directory path to store the generated script.
    Location string
    The name or ID of the Satellite location.
    CoreosHost bool
    = (Optional, Bool) True if attaching a CoreOS host to a CoreOS-enabled location. Host attach script will be in ignition file format. If attaching a RHEL host to a location, then the value is false.
    CustomScript string
    RHEL hosts only. The custom script that has to be appended to generated host script file. Either custom_script or host_provider is required. This custom_script will be appended to the downloaded host attach script. Find custom scripts for respective cloud providers aws, google, azure, ibm.
    HostLinkAgentEndpoint string
    The endpoint that the link agent uses to connect to the link tunnel server. Required for reduced firewall support.
    HostProvider string
    The name of host provider, such as ibm, aws or azure.
    Id string
    Labels []string
    ) The set of key-value pairs to label the host, such as ["cpu:4"] to describe the host capabilities.
    ScriptDir string
    The directory path to store the generated script.
    location String
    The name or ID of the Satellite location.
    coreosHost Boolean
    = (Optional, Bool) True if attaching a CoreOS host to a CoreOS-enabled location. Host attach script will be in ignition file format. If attaching a RHEL host to a location, then the value is false.
    customScript String
    RHEL hosts only. The custom script that has to be appended to generated host script file. Either custom_script or host_provider is required. This custom_script will be appended to the downloaded host attach script. Find custom scripts for respective cloud providers aws, google, azure, ibm.
    hostLinkAgentEndpoint String
    The endpoint that the link agent uses to connect to the link tunnel server. Required for reduced firewall support.
    hostProvider String
    The name of host provider, such as ibm, aws or azure.
    id String
    labels List<String>
    ) The set of key-value pairs to label the host, such as ["cpu:4"] to describe the host capabilities.
    scriptDir String
    The directory path to store the generated script.
    location string
    The name or ID of the Satellite location.
    coreosHost boolean
    = (Optional, Bool) True if attaching a CoreOS host to a CoreOS-enabled location. Host attach script will be in ignition file format. If attaching a RHEL host to a location, then the value is false.
    customScript string
    RHEL hosts only. The custom script that has to be appended to generated host script file. Either custom_script or host_provider is required. This custom_script will be appended to the downloaded host attach script. Find custom scripts for respective cloud providers aws, google, azure, ibm.
    hostLinkAgentEndpoint string
    The endpoint that the link agent uses to connect to the link tunnel server. Required for reduced firewall support.
    hostProvider string
    The name of host provider, such as ibm, aws or azure.
    id string
    labels string[]
    ) The set of key-value pairs to label the host, such as ["cpu:4"] to describe the host capabilities.
    scriptDir string
    The directory path to store the generated script.
    location str
    The name or ID of the Satellite location.
    coreos_host bool
    = (Optional, Bool) True if attaching a CoreOS host to a CoreOS-enabled location. Host attach script will be in ignition file format. If attaching a RHEL host to a location, then the value is false.
    custom_script str
    RHEL hosts only. The custom script that has to be appended to generated host script file. Either custom_script or host_provider is required. This custom_script will be appended to the downloaded host attach script. Find custom scripts for respective cloud providers aws, google, azure, ibm.
    host_link_agent_endpoint str
    The endpoint that the link agent uses to connect to the link tunnel server. Required for reduced firewall support.
    host_provider str
    The name of host provider, such as ibm, aws or azure.
    id str
    labels Sequence[str]
    ) The set of key-value pairs to label the host, such as ["cpu:4"] to describe the host capabilities.
    script_dir str
    The directory path to store the generated script.
    location String
    The name or ID of the Satellite location.
    coreosHost Boolean
    = (Optional, Bool) True if attaching a CoreOS host to a CoreOS-enabled location. Host attach script will be in ignition file format. If attaching a RHEL host to a location, then the value is false.
    customScript String
    RHEL hosts only. The custom script that has to be appended to generated host script file. Either custom_script or host_provider is required. This custom_script will be appended to the downloaded host attach script. Find custom scripts for respective cloud providers aws, google, azure, ibm.
    hostLinkAgentEndpoint String
    The endpoint that the link agent uses to connect to the link tunnel server. Required for reduced firewall support.
    hostProvider String
    The name of host provider, such as ibm, aws or azure.
    id String
    labels List<String>
    ) The set of key-value pairs to label the host, such as ["cpu:4"] to describe the host capabilities.
    scriptDir String
    The directory path to store the generated script.

    getSatelliteAttachHostScript Result

    The following output properties are available:

    Description string
    HostScript string
    Id string
    Location string
    ScriptDir string
    ScriptPath string
    CoreosHost bool
    CustomScript string
    HostLinkAgentEndpoint string
    HostProvider string
    Labels List<string>
    Description string
    HostScript string
    Id string
    Location string
    ScriptDir string
    ScriptPath string
    CoreosHost bool
    CustomScript string
    HostLinkAgentEndpoint string
    HostProvider string
    Labels []string
    description String
    hostScript String
    id String
    location String
    scriptDir String
    scriptPath String
    coreosHost Boolean
    customScript String
    hostLinkAgentEndpoint String
    hostProvider String
    labels List<String>
    description string
    hostScript string
    id string
    location string
    scriptDir string
    scriptPath string
    coreosHost boolean
    customScript string
    hostLinkAgentEndpoint string
    hostProvider string
    labels string[]
    description String
    hostScript String
    id String
    location String
    scriptDir String
    scriptPath String
    coreosHost Boolean
    customScript String
    hostLinkAgentEndpoint String
    hostProvider String
    labels List<String>

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud