1. Packages
  2. Exoscale
  3. API Docs
  4. getAntiAffinityGroup
Exoscale v0.59.0 published on Monday, May 20, 2024 by Pulumiverse

exoscale.getAntiAffinityGroup

Explore with Pulumi AI

exoscale logo
Exoscale v0.59.0 published on Monday, May 20, 2024 by Pulumiverse

    Fetch Exoscale Anti-Affinity Groups data.

    Corresponding resource: exoscale_anti_affinity_group.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as exoscale from "@pulumi/exoscale";
    
    const myAntiAffinityGroup = exoscale.getAntiAffinityGroup({
        name: "my-anti-affinity-group",
    });
    export const myAntiAffinityGroupId = myAntiAffinityGroup.then(myAntiAffinityGroup => myAntiAffinityGroup.id);
    
    import pulumi
    import pulumi_exoscale as exoscale
    
    my_anti_affinity_group = exoscale.get_anti_affinity_group(name="my-anti-affinity-group")
    pulumi.export("myAntiAffinityGroupId", my_anti_affinity_group.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-exoscale/sdk/go/exoscale"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		myAntiAffinityGroup, err := exoscale.LookupAntiAffinityGroup(ctx, &exoscale.LookupAntiAffinityGroupArgs{
    			Name: pulumi.StringRef("my-anti-affinity-group"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("myAntiAffinityGroupId", myAntiAffinityGroup.Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Exoscale = Pulumi.Exoscale;
    
    return await Deployment.RunAsync(() => 
    {
        var myAntiAffinityGroup = Exoscale.GetAntiAffinityGroup.Invoke(new()
        {
            Name = "my-anti-affinity-group",
        });
    
        return new Dictionary<string, object?>
        {
            ["myAntiAffinityGroupId"] = myAntiAffinityGroup.Apply(getAntiAffinityGroupResult => getAntiAffinityGroupResult.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.exoscale.ExoscaleFunctions;
    import com.pulumi.exoscale.inputs.GetAntiAffinityGroupArgs;
    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 myAntiAffinityGroup = ExoscaleFunctions.getAntiAffinityGroup(GetAntiAffinityGroupArgs.builder()
                .name("my-anti-affinity-group")
                .build());
    
            ctx.export("myAntiAffinityGroupId", myAntiAffinityGroup.applyValue(getAntiAffinityGroupResult -> getAntiAffinityGroupResult.id()));
        }
    }
    
    variables:
      myAntiAffinityGroup:
        fn::invoke:
          Function: exoscale:getAntiAffinityGroup
          Arguments:
            name: my-anti-affinity-group
    outputs:
      myAntiAffinityGroupId: ${myAntiAffinityGroup.id}
    

    Please refer to the examples directory for complete configuration examples.

    Using getAntiAffinityGroup

    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 getAntiAffinityGroup(args: GetAntiAffinityGroupArgs, opts?: InvokeOptions): Promise<GetAntiAffinityGroupResult>
    function getAntiAffinityGroupOutput(args: GetAntiAffinityGroupOutputArgs, opts?: InvokeOptions): Output<GetAntiAffinityGroupResult>
    def get_anti_affinity_group(id: Optional[str] = None,
                                name: Optional[str] = None,
                                opts: Optional[InvokeOptions] = None) -> GetAntiAffinityGroupResult
    def get_anti_affinity_group_output(id: Optional[pulumi.Input[str]] = None,
                                name: Optional[pulumi.Input[str]] = None,
                                opts: Optional[InvokeOptions] = None) -> Output[GetAntiAffinityGroupResult]
    func LookupAntiAffinityGroup(ctx *Context, args *LookupAntiAffinityGroupArgs, opts ...InvokeOption) (*LookupAntiAffinityGroupResult, error)
    func LookupAntiAffinityGroupOutput(ctx *Context, args *LookupAntiAffinityGroupOutputArgs, opts ...InvokeOption) LookupAntiAffinityGroupResultOutput

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

    public static class GetAntiAffinityGroup 
    {
        public static Task<GetAntiAffinityGroupResult> InvokeAsync(GetAntiAffinityGroupArgs args, InvokeOptions? opts = null)
        public static Output<GetAntiAffinityGroupResult> Invoke(GetAntiAffinityGroupInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAntiAffinityGroupResult> getAntiAffinityGroup(GetAntiAffinityGroupArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: exoscale:index/getAntiAffinityGroup:getAntiAffinityGroup
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    The anti-affinity group ID to match (conflicts with name).
    Name string
    The group name to match (conflicts with id).
    Id string
    The anti-affinity group ID to match (conflicts with name).
    Name string
    The group name to match (conflicts with id).
    id String
    The anti-affinity group ID to match (conflicts with name).
    name String
    The group name to match (conflicts with id).
    id string
    The anti-affinity group ID to match (conflicts with name).
    name string
    The group name to match (conflicts with id).
    id str
    The anti-affinity group ID to match (conflicts with name).
    name str
    The group name to match (conflicts with id).
    id String
    The anti-affinity group ID to match (conflicts with name).
    name String
    The group name to match (conflicts with id).

    getAntiAffinityGroup Result

    The following output properties are available:

    Instances List<string>
    The list of attached exoscalecomputeinstance (IDs).
    Id string
    The anti-affinity group ID to match (conflicts with name).
    Name string
    The group name to match (conflicts with id).
    Instances []string
    The list of attached exoscalecomputeinstance (IDs).
    Id string
    The anti-affinity group ID to match (conflicts with name).
    Name string
    The group name to match (conflicts with id).
    instances List<String>
    The list of attached exoscalecomputeinstance (IDs).
    id String
    The anti-affinity group ID to match (conflicts with name).
    name String
    The group name to match (conflicts with id).
    instances string[]
    The list of attached exoscalecomputeinstance (IDs).
    id string
    The anti-affinity group ID to match (conflicts with name).
    name string
    The group name to match (conflicts with id).
    instances Sequence[str]
    The list of attached exoscalecomputeinstance (IDs).
    id str
    The anti-affinity group ID to match (conflicts with name).
    name str
    The group name to match (conflicts with id).
    instances List<String>
    The list of attached exoscalecomputeinstance (IDs).
    id String
    The anti-affinity group ID to match (conflicts with name).
    name String
    The group name to match (conflicts with id).

    Package Details

    Repository
    exoscale pulumiverse/pulumi-exoscale
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the exoscale Terraform Provider.
    exoscale logo
    Exoscale v0.59.0 published on Monday, May 20, 2024 by Pulumiverse