routeros.File
Explore with Pulumi AI
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)
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
- File
Id 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
- File
Id 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
- file
Id 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
- file
Id 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
- file
Id 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:
- Creation
Time string - A time when the file was created
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Modified string - A time when the file was modified
- Package
Architecture string - Architecture that package is built for. Applies only to RouterOS ".npk" files
- Package
Built stringTime - A time when the package was built. Applies only to RouterOS ".npk" files
- Package
Name string - Name of the installable package. Applies only to RouterOS ".npk" files
- Package
Version 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
- Creation
Time string - A time when the file was created
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Modified string - A time when the file was modified
- Package
Architecture string - Architecture that package is built for. Applies only to RouterOS ".npk" files
- Package
Built stringTime - A time when the package was built. Applies only to RouterOS ".npk" files
- Package
Name string - Name of the installable package. Applies only to RouterOS ".npk" files
- Package
Version 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
- creation
Time String - A time when the file was created
- id String
- The provider-assigned unique ID for this managed resource.
- last
Modified String - A time when the file was modified
- package
Architecture String - Architecture that package is built for. Applies only to RouterOS ".npk" files
- package
Built StringTime - A time when the package was built. Applies only to RouterOS ".npk" files
- package
Name String - Name of the installable package. Applies only to RouterOS ".npk" files
- package
Version 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
- creation
Time string - A time when the file was created
- id string
- The provider-assigned unique ID for this managed resource.
- last
Modified string - A time when the file was modified
- package
Architecture string - Architecture that package is built for. Applies only to RouterOS ".npk" files
- package
Built stringTime - A time when the package was built. Applies only to RouterOS ".npk" files
- package
Name string - Name of the installable package. Applies only to RouterOS ".npk" files
- package
Version 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_ strtime - 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
- creation
Time String - A time when the file was created
- id String
- The provider-assigned unique ID for this managed resource.
- last
Modified String - A time when the file was modified
- package
Architecture String - Architecture that package is built for. Applies only to RouterOS ".npk" files
- package
Built StringTime - A time when the package was built. Applies only to RouterOS ".npk" files
- package
Name String - Name of the installable package. Applies only to RouterOS ".npk" files
- package
Version 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.
- Contents string
- The actual content of the file
- Creation
Time string - A time when the file was created
- File
Id string - The ID of this resource.
- Last
Modified string - A time when the file was modified
- Name string
- Name of the file
- Package
Architecture string - Architecture that package is built for. Applies only to RouterOS ".npk" files
- Package
Built stringTime - A time when the package was built. Applies only to RouterOS ".npk" files
- Package
Name string - Name of the installable package. Applies only to RouterOS ".npk" files
- Package
Version 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
- Creation
Time string - A time when the file was created
- File
Id string - The ID of this resource.
- Last
Modified string - A time when the file was modified
- Name string
- Name of the file
- Package
Architecture string - Architecture that package is built for. Applies only to RouterOS ".npk" files
- Package
Built stringTime - A time when the package was built. Applies only to RouterOS ".npk" files
- Package
Name string - Name of the installable package. Applies only to RouterOS ".npk" files
- Package
Version 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
- creation
Time String - A time when the file was created
- file
Id String - The ID of this resource.
- last
Modified String - A time when the file was modified
- name String
- Name of the file
- package
Architecture String - Architecture that package is built for. Applies only to RouterOS ".npk" files
- package
Built StringTime - A time when the package was built. Applies only to RouterOS ".npk" files
- package
Name String - Name of the installable package. Applies only to RouterOS ".npk" files
- package
Version 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
- creation
Time string - A time when the file was created
- file
Id string - The ID of this resource.
- last
Modified string - A time when the file was modified
- name string
- Name of the file
- package
Architecture string - Architecture that package is built for. Applies only to RouterOS ".npk" files
- package
Built stringTime - A time when the package was built. Applies only to RouterOS ".npk" files
- package
Name string - Name of the installable package. Applies only to RouterOS ".npk" files
- package
Version 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_ strtime - 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
- creation
Time String - A time when the file was created
- file
Id String - The ID of this resource.
- last
Modified String - A time when the file was modified
- name String
- Name of the file
- package
Architecture String - Architecture that package is built for. Applies only to RouterOS ".npk" files
- package
Built StringTime - A time when the package was built. Applies only to RouterOS ".npk" files
- package
Name String - Name of the installable package. Applies only to RouterOS ".npk" files
- package
Version 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.