1. Packages
  2. Fastly Provider
  3. API Docs
  4. getFastlyIpRanges
Fastly v8.13.0 published on Wednesday, Nov 13, 2024 by Pulumi

fastly.getFastlyIpRanges

Explore with Pulumi AI

fastly logo
Fastly v8.13.0 published on Wednesday, Nov 13, 2024 by Pulumi

    Use this data source to get the IP ranges of Fastly edge nodes.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    import * as fastly from "@pulumi/fastly";
    
    const fastly = fastly.getFastlyIpRanges({});
    const fromFastly = new aws.index.SecurityGroup("from_fastly", {
        name: "from_fastly",
        ingress: [{
            fromPort: "443",
            toPort: "443",
            protocol: "tcp",
            cidrBlocks: fastly.cidrBlocks,
            ipv6CidrBlocks: fastly.ipv6CidrBlocks,
        }],
    });
    
    import pulumi
    import pulumi_aws as aws
    import pulumi_fastly as fastly
    
    fastly = fastly.get_fastly_ip_ranges()
    from_fastly = aws.index.SecurityGroup("from_fastly",
        name=from_fastly,
        ingress=[{
            fromPort: 443,
            toPort: 443,
            protocol: tcp,
            cidrBlocks: fastly.cidr_blocks,
            ipv6CidrBlocks: fastly.ipv6_cidr_blocks,
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws"
    	"github.com/pulumi/pulumi-fastly/sdk/v8/go/fastly"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		fastly, err := fastly.GetFastlyIpRanges(ctx, map[string]interface{}{}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = aws.NewSecurityGroup(ctx, "from_fastly", &aws.SecurityGroupArgs{
    			Name: "from_fastly",
    			Ingress: []map[string]interface{}{
    				map[string]interface{}{
    					"fromPort":       "443",
    					"toPort":         "443",
    					"protocol":       "tcp",
    					"cidrBlocks":     fastly.CidrBlocks,
    					"ipv6CidrBlocks": fastly.Ipv6CidrBlocks,
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    using Fastly = Pulumi.Fastly;
    
    return await Deployment.RunAsync(() => 
    {
        var fastly = Fastly.GetFastlyIpRanges.Invoke();
    
        var fromFastly = new Aws.Index.SecurityGroup("from_fastly", new()
        {
            Name = "from_fastly",
            Ingress = new[]
            {
                
                {
                    { "fromPort", "443" },
                    { "toPort", "443" },
                    { "protocol", "tcp" },
                    { "cidrBlocks", fastly.Apply(getFastlyIpRangesResult => getFastlyIpRangesResult.CidrBlocks) },
                    { "ipv6CidrBlocks", fastly.Apply(getFastlyIpRangesResult => getFastlyIpRangesResult.Ipv6CidrBlocks) },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.fastly.FastlyFunctions;
    import com.pulumi.aws.securityGroup;
    import com.pulumi.aws.SecurityGroupArgs;
    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 fastly = FastlyFunctions.getFastlyIpRanges();
    
            var fromFastly = new SecurityGroup("fromFastly", SecurityGroupArgs.builder()
                .name("from_fastly")
                .ingress(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
                .build());
    
        }
    }
    
    resources:
      fromFastly:
        type: aws:securityGroup
        name: from_fastly
        properties:
          name: from_fastly
          ingress:
            - fromPort: '443'
              toPort: '443'
              protocol: tcp
              cidrBlocks: ${fastly.cidrBlocks}
              ipv6CidrBlocks: ${fastly.ipv6CidrBlocks}
    variables:
      fastly:
        fn::invoke:
          Function: fastly:getFastlyIpRanges
          Arguments: {}
    

    Using getFastlyIpRanges

    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 getFastlyIpRanges(opts?: InvokeOptions): Promise<GetFastlyIpRangesResult>
    function getFastlyIpRangesOutput(opts?: InvokeOptions): Output<GetFastlyIpRangesResult>
    def get_fastly_ip_ranges(opts: Optional[InvokeOptions] = None) -> GetFastlyIpRangesResult
    def get_fastly_ip_ranges_output(opts: Optional[InvokeOptions] = None) -> Output[GetFastlyIpRangesResult]
    func GetFastlyIpRanges(ctx *Context, opts ...InvokeOption) (*GetFastlyIpRangesResult, error)
    func GetFastlyIpRangesOutput(ctx *Context, opts ...InvokeOption) GetFastlyIpRangesResultOutput

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

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

    getFastlyIpRanges Result

    The following output properties are available:

    CidrBlocks List<string>
    The lexically ordered list of ipv4 CIDR blocks.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ipv6CidrBlocks List<string>
    The lexically ordered list of ipv6 CIDR blocks.
    CidrBlocks []string
    The lexically ordered list of ipv4 CIDR blocks.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ipv6CidrBlocks []string
    The lexically ordered list of ipv6 CIDR blocks.
    cidrBlocks List<String>
    The lexically ordered list of ipv4 CIDR blocks.
    id String
    The provider-assigned unique ID for this managed resource.
    ipv6CidrBlocks List<String>
    The lexically ordered list of ipv6 CIDR blocks.
    cidrBlocks string[]
    The lexically ordered list of ipv4 CIDR blocks.
    id string
    The provider-assigned unique ID for this managed resource.
    ipv6CidrBlocks string[]
    The lexically ordered list of ipv6 CIDR blocks.
    cidr_blocks Sequence[str]
    The lexically ordered list of ipv4 CIDR blocks.
    id str
    The provider-assigned unique ID for this managed resource.
    ipv6_cidr_blocks Sequence[str]
    The lexically ordered list of ipv6 CIDR blocks.
    cidrBlocks List<String>
    The lexically ordered list of ipv4 CIDR blocks.
    id String
    The provider-assigned unique ID for this managed resource.
    ipv6CidrBlocks List<String>
    The lexically ordered list of ipv6 CIDR blocks.

    Package Details

    Repository
    Fastly pulumi/pulumi-fastly
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the fastly Terraform Provider.
    fastly logo
    Fastly v8.13.0 published on Wednesday, Nov 13, 2024 by Pulumi