awx.Host
Explore with Pulumi AI
TBD
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as awx from "@pulumi/awx";
const k3snode1 = new awx.Host("k3snode1", {
description: "pi node 1",
inventoryId: data.awx_inventory["default"].id,
groupIds: [
data.awx_inventory_group["default"].id,
data.awx_inventory_group.pinodes.id,
],
enabled: true,
variables: `---
ansible_host: 192.168.178.29
`,
});
import pulumi
import pulumi_awx as awx
k3snode1 = awx.Host("k3snode1",
description="pi node 1",
inventory_id=data["awx_inventory"]["default"]["id"],
group_ids=[
data["awx_inventory_group"]["default"]["id"],
data["awx_inventory_group"]["pinodes"]["id"],
],
enabled=True,
variables="""---
ansible_host: 192.168.178.29
""")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/awx/awx"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := awx.NewHost(ctx, "k3snode1", &awx.HostArgs{
Description: pulumi.String("pi node 1"),
InventoryId: pulumi.Any(data.Awx_inventory.Default.Id),
GroupIds: pulumi.Float64Array{
data.Awx_inventory_group.Default.Id,
data.Awx_inventory_group.Pinodes.Id,
},
Enabled: pulumi.Bool(true),
Variables: pulumi.String("---\nansible_host: 192.168.178.29\n"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Awx = Pulumi.Awx;
return await Deployment.RunAsync(() =>
{
var k3snode1 = new Awx.Host("k3snode1", new()
{
Description = "pi node 1",
InventoryId = data.Awx_inventory.Default.Id,
GroupIds = new[]
{
data.Awx_inventory_group.Default.Id,
data.Awx_inventory_group.Pinodes.Id,
},
Enabled = true,
Variables = @"---
ansible_host: 192.168.178.29
",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.awx.Host;
import com.pulumi.awx.HostArgs;
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 k3snode1 = new Host("k3snode1", HostArgs.builder()
.description("pi node 1")
.inventoryId(data.awx_inventory().default().id())
.groupIds(
data.awx_inventory_group().default().id(),
data.awx_inventory_group().pinodes().id())
.enabled(true)
.variables("""
---
ansible_host: 192.168.178.29
""")
.build());
}
}
resources:
k3snode1:
type: awx:Host
properties:
description: pi node 1
inventoryId: ${data.awx_inventory.default.id}
groupIds:
- ${data.awx_inventory_group.default.id}
- ${data.awx_inventory_group.pinodes.id}
enabled: true
variables: |
---
ansible_host: 192.168.178.29
Create Host Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Host(name: string, args: HostArgs, opts?: CustomResourceOptions);
@overload
def Host(resource_name: str,
args: HostArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Host(resource_name: str,
opts: Optional[ResourceOptions] = None,
inventory_id: Optional[float] = None,
description: Optional[str] = None,
enabled: Optional[bool] = None,
group_ids: Optional[Sequence[float]] = None,
host_id: Optional[str] = None,
instance_id: Optional[str] = None,
name: Optional[str] = None,
variables: Optional[str] = None)
func NewHost(ctx *Context, name string, args HostArgs, opts ...ResourceOption) (*Host, error)
public Host(string name, HostArgs args, CustomResourceOptions? opts = null)
type: awx:Host
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args HostArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args HostArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args HostArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args HostArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args HostArgs
- 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 hostResource = new Awx.Host("hostResource", new()
{
InventoryId = 0,
Description = "string",
Enabled = false,
GroupIds = new[]
{
0,
},
HostId = "string",
InstanceId = "string",
Name = "string",
Variables = "string",
});
example, err := awx.NewHost(ctx, "hostResource", &awx.HostArgs{
InventoryId: pulumi.Float64(0),
Description: pulumi.String("string"),
Enabled: pulumi.Bool(false),
GroupIds: pulumi.Float64Array{
pulumi.Float64(0),
},
HostId: pulumi.String("string"),
InstanceId: pulumi.String("string"),
Name: pulumi.String("string"),
Variables: pulumi.String("string"),
})
var hostResource = new Host("hostResource", HostArgs.builder()
.inventoryId(0)
.description("string")
.enabled(false)
.groupIds(0)
.hostId("string")
.instanceId("string")
.name("string")
.variables("string")
.build());
host_resource = awx.Host("hostResource",
inventory_id=0,
description="string",
enabled=False,
group_ids=[0],
host_id="string",
instance_id="string",
name="string",
variables="string")
const hostResource = new awx.Host("hostResource", {
inventoryId: 0,
description: "string",
enabled: false,
groupIds: [0],
hostId: "string",
instanceId: "string",
name: "string",
variables: "string",
});
type: awx:Host
properties:
description: string
enabled: false
groupIds:
- 0
hostId: string
instanceId: string
inventoryId: 0
name: string
variables: string
Host 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 Host resource accepts the following input properties:
- Inventory
Id double - Description string
- Enabled bool
- Group
Ids List<double> - Host
Id string - Instance
Id string - Name string
- Variables string
- Inventory
Id float64 - Description string
- Enabled bool
- Group
Ids []float64 - Host
Id string - Instance
Id string - Name string
- Variables string
- inventory
Id Double - description String
- enabled Boolean
- group
Ids List<Double> - host
Id String - instance
Id String - name String
- variables String
- inventory
Id number - description string
- enabled boolean
- group
Ids number[] - host
Id string - instance
Id string - name string
- variables string
- inventory_
id float - description str
- enabled bool
- group_
ids Sequence[float] - host_
id str - instance_
id str - name str
- variables str
- inventory
Id Number - description String
- enabled Boolean
- group
Ids List<Number> - host
Id String - instance
Id String - name String
- variables String
Outputs
All input properties are implicitly available as output properties. Additionally, the Host 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 Host Resource
Get an existing Host 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?: HostState, opts?: CustomResourceOptions): Host
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
enabled: Optional[bool] = None,
group_ids: Optional[Sequence[float]] = None,
host_id: Optional[str] = None,
instance_id: Optional[str] = None,
inventory_id: Optional[float] = None,
name: Optional[str] = None,
variables: Optional[str] = None) -> Host
func GetHost(ctx *Context, name string, id IDInput, state *HostState, opts ...ResourceOption) (*Host, error)
public static Host Get(string name, Input<string> id, HostState? state, CustomResourceOptions? opts = null)
public static Host get(String name, Output<String> id, HostState state, CustomResourceOptions options)
resources: _: type: awx:Host get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- Description string
- Enabled bool
- Group
Ids List<double> - Host
Id string - Instance
Id string - Inventory
Id double - Name string
- Variables string
- Description string
- Enabled bool
- Group
Ids []float64 - Host
Id string - Instance
Id string - Inventory
Id float64 - Name string
- Variables string
- description String
- enabled Boolean
- group
Ids List<Double> - host
Id String - instance
Id String - inventory
Id Double - name String
- variables String
- description string
- enabled boolean
- group
Ids number[] - host
Id string - instance
Id string - inventory
Id number - name string
- variables string
- description str
- enabled bool
- group_
ids Sequence[float] - host_
id str - instance_
id str - inventory_
id float - name str
- variables str
- description String
- enabled Boolean
- group
Ids List<Number> - host
Id String - instance
Id String - inventory
Id Number - name String
- variables String
Package Details
- Repository
- awx denouche/terraform-provider-awx
- License
- Notes
- This Pulumi package is based on the
awx
Terraform Provider.