1. Packages
  2. Buildkite
  3. API Docs
  4. getMeta
Buildkite v3.1.6 published on Wednesday, Apr 3, 2024 by Pulumiverse

buildkite.getMeta

Explore with Pulumi AI

buildkite logo
Buildkite v3.1.6 published on Wednesday, Apr 3, 2024 by Pulumiverse

    Use this data source to look up the source IP addresses that Buildkite may use to send external requests, including webhooks and API calls to source control systems (like GitHub Enterprise Server and BitBucket Server).

    More info in the Buildkite documentation.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    import * as buildkite from "@pulumi/buildkite";
    
    const ips = buildkite.getMeta({});
    // Create an AWS security group allowing ingress from Buildkite
    const fromBuildkite = new aws.ec2.SecurityGroup("fromBuildkite", {ingress: [{
        fromPort: "*",
        toPort: 443,
        protocol: "tcp",
        cidrBlocks: ips.then(ips => ips.webhookIps),
    }]});
    
    import pulumi
    import pulumi_aws as aws
    import pulumi_buildkite as buildkite
    
    ips = buildkite.get_meta()
    # Create an AWS security group allowing ingress from Buildkite
    from_buildkite = aws.ec2.SecurityGroup("fromBuildkite", ingress=[aws.ec2.SecurityGroupIngressArgs(
        from_port="*",
        to_port=443,
        protocol="tcp",
        cidr_blocks=ips.webhook_ips,
    )])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-buildkite/sdk/v3/go/buildkite"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ips, err := buildkite.GetMeta(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		// Create an AWS security group allowing ingress from Buildkite
    		_, err = ec2.NewSecurityGroup(ctx, "fromBuildkite", &ec2.SecurityGroupArgs{
    			Ingress: ec2.SecurityGroupIngressArray{
    				&ec2.SecurityGroupIngressArgs{
    					FromPort:   pulumi.Int("*"),
    					ToPort:     pulumi.Int(443),
    					Protocol:   pulumi.String("tcp"),
    					CidrBlocks: interface{}(ips.WebhookIps),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    using Buildkite = Pulumi.Buildkite;
    
    return await Deployment.RunAsync(() => 
    {
        var ips = Buildkite.GetMeta.Invoke();
    
        // Create an AWS security group allowing ingress from Buildkite
        var fromBuildkite = new Aws.Ec2.SecurityGroup("fromBuildkite", new()
        {
            Ingress = new[]
            {
                new Aws.Ec2.Inputs.SecurityGroupIngressArgs
                {
                    FromPort = "*",
                    ToPort = 443,
                    Protocol = "tcp",
                    CidrBlocks = ips.Apply(getMetaResult => getMetaResult.WebhookIps),
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.buildkite.BuildkiteFunctions;
    import com.pulumi.aws.ec2.SecurityGroup;
    import com.pulumi.aws.ec2.SecurityGroupArgs;
    import com.pulumi.aws.ec2.inputs.SecurityGroupIngressArgs;
    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 ips = BuildkiteFunctions.getMeta();
    
            var fromBuildkite = new SecurityGroup("fromBuildkite", SecurityGroupArgs.builder()        
                .ingress(SecurityGroupIngressArgs.builder()
                    .fromPort("*")
                    .toPort("443")
                    .protocol("tcp")
                    .cidrBlocks(ips.applyValue(getMetaResult -> getMetaResult.webhookIps()))
                    .build())
                .build());
    
        }
    }
    
    resources:
      # Create an AWS security group allowing ingress from Buildkite
      fromBuildkite:
        type: aws:ec2:SecurityGroup
        properties:
          ingress:
            - fromPort: '*'
              toPort: '443'
              protocol: tcp
              cidrBlocks: ${ips.webhookIps}
    variables:
      ips:
        fn::invoke:
          Function: buildkite:getMeta
          Arguments: {}
    

    Using getMeta

    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 getMeta(opts?: InvokeOptions): Promise<GetMetaResult>
    function getMetaOutput(opts?: InvokeOptions): Output<GetMetaResult>
    def get_meta(opts: Optional[InvokeOptions] = None) -> GetMetaResult
    def get_meta_output(opts: Optional[InvokeOptions] = None) -> Output[GetMetaResult]
    func GetMeta(ctx *Context, opts ...InvokeOption) (*GetMetaResult, error)
    func GetMetaOutput(ctx *Context, opts ...InvokeOption) GetMetaResultOutput

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

    public static class GetMeta 
    {
        public static Task<GetMetaResult> InvokeAsync(InvokeOptions? opts = null)
        public static Output<GetMetaResult> Invoke(InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetMetaResult> getMeta(InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: buildkite:index/getMeta:getMeta
      arguments:
        # arguments dictionary

    getMeta Result

    The following output properties are available:

    Id string
    Fixed value: https://api.buildkite.com/v2/meta.
    WebhookIps List<string>
    List of IPs in CIDR format.
    Id string
    Fixed value: https://api.buildkite.com/v2/meta.
    WebhookIps []string
    List of IPs in CIDR format.
    id String
    Fixed value: https://api.buildkite.com/v2/meta.
    webhookIps List<String>
    List of IPs in CIDR format.
    id string
    Fixed value: https://api.buildkite.com/v2/meta.
    webhookIps string[]
    List of IPs in CIDR format.
    id str
    Fixed value: https://api.buildkite.com/v2/meta.
    webhook_ips Sequence[str]
    List of IPs in CIDR format.
    id String
    Fixed value: https://api.buildkite.com/v2/meta.
    webhookIps List<String>
    List of IPs in CIDR format.

    Package Details

    Repository
    buildkite pulumiverse/pulumi-buildkite
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the buildkite Terraform Provider.
    buildkite logo
    Buildkite v3.1.6 published on Wednesday, Apr 3, 2024 by Pulumiverse