1. Packages
  2. Routeros Provider
  3. API Docs
  4. File
routeros 1.83.1 published on Monday, Apr 28, 2025 by terraform-routeros

routeros.File

Explore with Pulumi AI

routeros logo
routeros 1.83.1 published on Monday, Apr 28, 2025 by terraform-routeros

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as routeros from "@pulumi/routeros";
    
    const test = new routeros.File("test", {contents: "This is a test"});
    
    import pulumi
    import pulumi_routeros as routeros
    
    test = routeros.File("test", contents="This is a test")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/routeros/routeros"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := routeros.NewFile(ctx, "test", &routeros.FileArgs{
    			Contents: pulumi.String("This is a test"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Routeros = Pulumi.Routeros;
    
    return await Deployment.RunAsync(() => 
    {
        var test = new Routeros.File("test", new()
        {
            Contents = "This is a test",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.routeros.File;
    import com.pulumi.routeros.FileArgs;
    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 test = new File("test", FileArgs.builder()
                .contents("This is a test")
                .build());
    
        }
    }
    
    resources:
      test:
        type: routeros:File
        properties:
          contents: This is a test
    

    Create File Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new File(name: string, args?: FileArgs, opts?: CustomResourceOptions);
    @overload
    def File(resource_name: str,
             args: Optional[FileArgs] = None,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def File(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             ___id_: Optional[float] = None,
             ___path_: Optional[str] = None,
             contents: Optional[str] = None,
             file_id: Optional[str] = None,
             name: Optional[str] = None)
    func NewFile(ctx *Context, name string, args *FileArgs, opts ...ResourceOption) (*File, error)
    public File(string name, FileArgs? args = null, CustomResourceOptions? opts = null)
    public File(String name, FileArgs args)
    public File(String name, FileArgs args, CustomResourceOptions options)
    
    type: routeros:File
    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 FileArgs
    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 FileArgs
    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 FileArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args FileArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args FileArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    File 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 File resource accepts the following input properties:

    Contents string
    The actual content of the file
    FileId string
    The ID of this resource.
    Name string
    Name of the file
    ___id_ double
    Resource ID type (.id / name). This is an internal service field, setting a value is not required.
    ___path_ string
    Resource path for CRUD operations. This is an internal service field, setting a value is not required.
    Contents string
    The actual content of the file
    FileId string
    The ID of this resource.
    Name string
    Name of the file
    ___id_ float64
    Resource ID type (.id / name). This is an internal service field, setting a value is not required.
    ___path_ string
    Resource path for CRUD operations. This is an internal service field, setting a value is not required.
    ___id_ Double
    Resource ID type (.id / name). This is an internal service field, setting a value is not required.
    ___path_ String
    Resource path for CRUD operations. This is an internal service field, setting a value is not required.
    contents String
    The actual content of the file
    fileId String
    The ID of this resource.
    name String
    Name of the file
    ___id_ number
    Resource ID type (.id / name). This is an internal service field, setting a value is not required.
    ___path_ string
    Resource path for CRUD operations. This is an internal service field, setting a value is not required.
    contents string
    The actual content of the file
    fileId string
    The ID of this resource.
    name string
    Name of the file
    ___id_ float
    Resource ID type (.id / name). This is an internal service field, setting a value is not required.
    ___path_ str
    Resource path for CRUD operations. This is an internal service field, setting a value is not required.
    contents str
    The actual content of the file
    file_id str
    The ID of this resource.
    name str
    Name of the file
    ___id_ Number
    Resource ID type (.id / name). This is an internal service field, setting a value is not required.
    ___path_ String
    Resource path for CRUD operations. This is an internal service field, setting a value is not required.
    contents String
    The actual content of the file
    fileId String
    The ID of this resource.
    name String
    Name of the file

    Outputs

    All input properties are implicitly available as output properties. Additionally, the File resource produces the following output properties:

    CreationTime string
    A time when the file was created
    Id string
    The provider-assigned unique ID for this managed resource.
    LastModified string
    A time when the file was modified
    PackageArchitecture string
    Architecture that package is built for. Applies only to RouterOS ".npk" files
    PackageBuiltTime string
    A time when the package was built. Applies only to RouterOS ".npk" files
    PackageName string
    Name of the installable package. Applies only to RouterOS ".npk" files
    PackageVersion string
    A version of the installable package. Applies only to RouterOS ".npk" files
    Size double
    File size in bytes
    Type string
    Type of the file. For folders, the file type is the directory
    CreationTime string
    A time when the file was created
    Id string
    The provider-assigned unique ID for this managed resource.
    LastModified string
    A time when the file was modified
    PackageArchitecture string
    Architecture that package is built for. Applies only to RouterOS ".npk" files
    PackageBuiltTime string
    A time when the package was built. Applies only to RouterOS ".npk" files
    PackageName string
    Name of the installable package. Applies only to RouterOS ".npk" files
    PackageVersion string
    A version of the installable package. Applies only to RouterOS ".npk" files
    Size float64
    File size in bytes
    Type string
    Type of the file. For folders, the file type is the directory
    creationTime String
    A time when the file was created
    id String
    The provider-assigned unique ID for this managed resource.
    lastModified String
    A time when the file was modified
    packageArchitecture String
    Architecture that package is built for. Applies only to RouterOS ".npk" files
    packageBuiltTime String
    A time when the package was built. Applies only to RouterOS ".npk" files
    packageName String
    Name of the installable package. Applies only to RouterOS ".npk" files
    packageVersion String
    A version of the installable package. Applies only to RouterOS ".npk" files
    size Double
    File size in bytes
    type String
    Type of the file. For folders, the file type is the directory
    creationTime string
    A time when the file was created
    id string
    The provider-assigned unique ID for this managed resource.
    lastModified string
    A time when the file was modified
    packageArchitecture string
    Architecture that package is built for. Applies only to RouterOS ".npk" files
    packageBuiltTime string
    A time when the package was built. Applies only to RouterOS ".npk" files
    packageName string
    Name of the installable package. Applies only to RouterOS ".npk" files
    packageVersion string
    A version of the installable package. Applies only to RouterOS ".npk" files
    size number
    File size in bytes
    type string
    Type of the file. For folders, the file type is the directory
    creation_time str
    A time when the file was created
    id str
    The provider-assigned unique ID for this managed resource.
    last_modified str
    A time when the file was modified
    package_architecture str
    Architecture that package is built for. Applies only to RouterOS ".npk" files
    package_built_time str
    A time when the package was built. Applies only to RouterOS ".npk" files
    package_name str
    Name of the installable package. Applies only to RouterOS ".npk" files
    package_version str
    A version of the installable package. Applies only to RouterOS ".npk" files
    size float
    File size in bytes
    type str
    Type of the file. For folders, the file type is the directory
    creationTime String
    A time when the file was created
    id String
    The provider-assigned unique ID for this managed resource.
    lastModified String
    A time when the file was modified
    packageArchitecture String
    Architecture that package is built for. Applies only to RouterOS ".npk" files
    packageBuiltTime String
    A time when the package was built. Applies only to RouterOS ".npk" files
    packageName String
    Name of the installable package. Applies only to RouterOS ".npk" files
    packageVersion String
    A version of the installable package. Applies only to RouterOS ".npk" files
    size Number
    File size in bytes
    type String
    Type of the file. For folders, the file type is the directory

    Look up Existing File Resource

    Get an existing File 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?: FileState, opts?: CustomResourceOptions): File
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            ___id_: Optional[float] = None,
            ___path_: Optional[str] = None,
            contents: Optional[str] = None,
            creation_time: Optional[str] = None,
            file_id: Optional[str] = None,
            last_modified: Optional[str] = None,
            name: Optional[str] = None,
            package_architecture: Optional[str] = None,
            package_built_time: Optional[str] = None,
            package_name: Optional[str] = None,
            package_version: Optional[str] = None,
            size: Optional[float] = None,
            type: Optional[str] = None) -> File
    func GetFile(ctx *Context, name string, id IDInput, state *FileState, opts ...ResourceOption) (*File, error)
    public static File Get(string name, Input<string> id, FileState? state, CustomResourceOptions? opts = null)
    public static File get(String name, Output<String> id, FileState state, CustomResourceOptions options)
    resources:  _:    type: routeros:File    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.
    The following state arguments are supported:
    Contents string
    The actual content of the file
    CreationTime string
    A time when the file was created
    FileId string
    The ID of this resource.
    LastModified string
    A time when the file was modified
    Name string
    Name of the file
    PackageArchitecture string
    Architecture that package is built for. Applies only to RouterOS ".npk" files
    PackageBuiltTime string
    A time when the package was built. Applies only to RouterOS ".npk" files
    PackageName string
    Name of the installable package. Applies only to RouterOS ".npk" files
    PackageVersion string
    A version of the installable package. Applies only to RouterOS ".npk" files
    Size double
    File size in bytes
    Type string
    Type of the file. For folders, the file type is the directory
    ___id_ double
    Resource ID type (.id / name). This is an internal service field, setting a value is not required.
    ___path_ string
    Resource path for CRUD operations. This is an internal service field, setting a value is not required.
    Contents string
    The actual content of the file
    CreationTime string
    A time when the file was created
    FileId string
    The ID of this resource.
    LastModified string
    A time when the file was modified
    Name string
    Name of the file
    PackageArchitecture string
    Architecture that package is built for. Applies only to RouterOS ".npk" files
    PackageBuiltTime string
    A time when the package was built. Applies only to RouterOS ".npk" files
    PackageName string
    Name of the installable package. Applies only to RouterOS ".npk" files
    PackageVersion string
    A version of the installable package. Applies only to RouterOS ".npk" files
    Size float64
    File size in bytes
    Type string
    Type of the file. For folders, the file type is the directory
    ___id_ float64
    Resource ID type (.id / name). This is an internal service field, setting a value is not required.
    ___path_ string
    Resource path for CRUD operations. This is an internal service field, setting a value is not required.
    ___id_ Double
    Resource ID type (.id / name). This is an internal service field, setting a value is not required.
    ___path_ String
    Resource path for CRUD operations. This is an internal service field, setting a value is not required.
    contents String
    The actual content of the file
    creationTime String
    A time when the file was created
    fileId String
    The ID of this resource.
    lastModified String
    A time when the file was modified
    name String
    Name of the file
    packageArchitecture String
    Architecture that package is built for. Applies only to RouterOS ".npk" files
    packageBuiltTime String
    A time when the package was built. Applies only to RouterOS ".npk" files
    packageName String
    Name of the installable package. Applies only to RouterOS ".npk" files
    packageVersion String
    A version of the installable package. Applies only to RouterOS ".npk" files
    size Double
    File size in bytes
    type String
    Type of the file. For folders, the file type is the directory
    ___id_ number
    Resource ID type (.id / name). This is an internal service field, setting a value is not required.
    ___path_ string
    Resource path for CRUD operations. This is an internal service field, setting a value is not required.
    contents string
    The actual content of the file
    creationTime string
    A time when the file was created
    fileId string
    The ID of this resource.
    lastModified string
    A time when the file was modified
    name string
    Name of the file
    packageArchitecture string
    Architecture that package is built for. Applies only to RouterOS ".npk" files
    packageBuiltTime string
    A time when the package was built. Applies only to RouterOS ".npk" files
    packageName string
    Name of the installable package. Applies only to RouterOS ".npk" files
    packageVersion string
    A version of the installable package. Applies only to RouterOS ".npk" files
    size number
    File size in bytes
    type string
    Type of the file. For folders, the file type is the directory
    ___id_ float
    Resource ID type (.id / name). This is an internal service field, setting a value is not required.
    ___path_ str
    Resource path for CRUD operations. This is an internal service field, setting a value is not required.
    contents str
    The actual content of the file
    creation_time str
    A time when the file was created
    file_id str
    The ID of this resource.
    last_modified str
    A time when the file was modified
    name str
    Name of the file
    package_architecture str
    Architecture that package is built for. Applies only to RouterOS ".npk" files
    package_built_time str
    A time when the package was built. Applies only to RouterOS ".npk" files
    package_name str
    Name of the installable package. Applies only to RouterOS ".npk" files
    package_version str
    A version of the installable package. Applies only to RouterOS ".npk" files
    size float
    File size in bytes
    type str
    Type of the file. For folders, the file type is the directory
    ___id_ Number
    Resource ID type (.id / name). This is an internal service field, setting a value is not required.
    ___path_ String
    Resource path for CRUD operations. This is an internal service field, setting a value is not required.
    contents String
    The actual content of the file
    creationTime String
    A time when the file was created
    fileId String
    The ID of this resource.
    lastModified String
    A time when the file was modified
    name String
    Name of the file
    packageArchitecture String
    Architecture that package is built for. Applies only to RouterOS ".npk" files
    packageBuiltTime String
    A time when the package was built. Applies only to RouterOS ".npk" files
    packageName String
    Name of the installable package. Applies only to RouterOS ".npk" files
    packageVersion String
    A version of the installable package. Applies only to RouterOS ".npk" files
    size Number
    File size in bytes
    type String
    Type of the file. For folders, the file type is the directory

    Import

    #The ID can be found via API or the terminal

    #The command for the terminal is -> :put [/file get [print show-ids]]

    $ pulumi import routeros:index/file:File test "*1"
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    routeros terraform-routeros/terraform-provider-routeros
    License
    Notes
    This Pulumi package is based on the routeros Terraform Provider.
    routeros logo
    routeros 1.83.1 published on Monday, Apr 28, 2025 by terraform-routeros