ibm.getSatelliteAttachHostScript
Explore with Pulumi AI
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.
- 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 string - RHEL hosts only. The custom script that has to be appended to generated host script file. Either
custom_script
orhost_provider
is required. Thiscustom_script
will be appended to the downloaded host attach script. Find custom scripts for respective cloud providers aws, google, azure, ibm. - Host
Link stringAgent Endpoint - The endpoint that the link agent uses to connect to the link tunnel server. Required for reduced firewall support.
- Host
Provider string - The name of host provider, such as
ibm
,aws
orazure
. - Id string
- Labels List<string>
- ) The set of key-value pairs to label the host, such as
["cpu:4"]
to describe the host capabilities. - Script
Dir string - The directory path to store the generated script.
- Location string
- 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 string - RHEL hosts only. The custom script that has to be appended to generated host script file. Either
custom_script
orhost_provider
is required. Thiscustom_script
will be appended to the downloaded host attach script. Find custom scripts for respective cloud providers aws, google, azure, ibm. - Host
Link stringAgent Endpoint - The endpoint that the link agent uses to connect to the link tunnel server. Required for reduced firewall support.
- Host
Provider string - The name of host provider, such as
ibm
,aws
orazure
. - Id string
- Labels []string
- ) The set of key-value pairs to label the host, such as
["cpu:4"]
to describe the host capabilities. - Script
Dir string - The directory path to store the generated script.
- location String
- The name or ID of the Satellite location.
- coreos
Host 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.
- custom
Script String - RHEL hosts only. The custom script that has to be appended to generated host script file. Either
custom_script
orhost_provider
is required. Thiscustom_script
will be appended to the downloaded host attach script. Find custom scripts for respective cloud providers aws, google, azure, ibm. - host
Link StringAgent Endpoint - The endpoint that the link agent uses to connect to the link tunnel server. Required for reduced firewall support.
- host
Provider String - The name of host provider, such as
ibm
,aws
orazure
. - id String
- labels List<String>
- ) The set of key-value pairs to label the host, such as
["cpu:4"]
to describe the host capabilities. - script
Dir String - The directory path to store the generated script.
- location string
- The name or ID of the Satellite location.
- coreos
Host 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.
- custom
Script string - RHEL hosts only. The custom script that has to be appended to generated host script file. Either
custom_script
orhost_provider
is required. Thiscustom_script
will be appended to the downloaded host attach script. Find custom scripts for respective cloud providers aws, google, azure, ibm. - host
Link stringAgent Endpoint - The endpoint that the link agent uses to connect to the link tunnel server. Required for reduced firewall support.
- host
Provider string - The name of host provider, such as
ibm
,aws
orazure
. - id string
- labels string[]
- ) The set of key-value pairs to label the host, such as
["cpu:4"]
to describe the host capabilities. - script
Dir 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
orhost_provider
is required. Thiscustom_script
will be appended to the downloaded host attach script. Find custom scripts for respective cloud providers aws, google, azure, ibm. - host_
link_ stragent_ endpoint - 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
orazure
. - 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.
- coreos
Host 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.
- custom
Script String - RHEL hosts only. The custom script that has to be appended to generated host script file. Either
custom_script
orhost_provider
is required. Thiscustom_script
will be appended to the downloaded host attach script. Find custom scripts for respective cloud providers aws, google, azure, ibm. - host
Link StringAgent Endpoint - The endpoint that the link agent uses to connect to the link tunnel server. Required for reduced firewall support.
- host
Provider String - The name of host provider, such as
ibm
,aws
orazure
. - id String
- labels List<String>
- ) The set of key-value pairs to label the host, such as
["cpu:4"]
to describe the host capabilities. - script
Dir String - The directory path to store the generated script.
getSatelliteAttachHostScript Result
The following output properties are available:
- Description string
- Host
Script string - Id string
- Location string
- Script
Dir string - Script
Path string - Coreos
Host bool - Custom
Script string - Host
Link stringAgent Endpoint - Host
Provider string - Labels List<string>
- Description string
- Host
Script string - Id string
- Location string
- Script
Dir string - Script
Path string - Coreos
Host bool - Custom
Script string - Host
Link stringAgent Endpoint - Host
Provider string - Labels []string
- description String
- host
Script String - id String
- location String
- script
Dir String - script
Path String - coreos
Host Boolean - custom
Script String - host
Link StringAgent Endpoint - host
Provider String - labels List<String>
- description string
- host
Script string - id string
- location string
- script
Dir string - script
Path string - coreos
Host boolean - custom
Script string - host
Link stringAgent Endpoint - host
Provider string - labels string[]
- description str
- host_
script str - id str
- location str
- script_
dir str - script_
path str - coreos_
host bool - custom_
script str - host_
link_ stragent_ endpoint - host_
provider str - labels Sequence[str]
- description String
- host
Script String - id String
- location String
- script
Dir String - script
Path String - coreos
Host Boolean - custom
Script String - host
Link StringAgent Endpoint - host
Provider 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.