sql.Migrate
Explore with Pulumi AI
Example Usage
Create Migrate Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Migrate(name: string, args?: MigrateArgs, opts?: CustomResourceOptions);
@overload
def Migrate(resource_name: str,
args: Optional[MigrateArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Migrate(resource_name: str,
opts: Optional[ResourceOptions] = None,
migrations: Optional[Sequence[MigrateMigrationArgs]] = None)
func NewMigrate(ctx *Context, name string, args *MigrateArgs, opts ...ResourceOption) (*Migrate, error)
public Migrate(string name, MigrateArgs? args = null, CustomResourceOptions? opts = null)
public Migrate(String name, MigrateArgs args)
public Migrate(String name, MigrateArgs args, CustomResourceOptions options)
type: sql:Migrate
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 MigrateArgs
- 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 MigrateArgs
- 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 MigrateArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args MigrateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args MigrateArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var migrateResource = new Sql.Migrate("migrateResource", new()
{
Migrations = new[]
{
new Sql.Inputs.MigrateMigrationArgs
{
Down = "string",
Id = "string",
Up = "string",
},
},
});
example, err := sql.NewMigrate(ctx, "migrateResource", &sql.MigrateArgs{
Migrations: sql.MigrateMigrationArray{
&sql.MigrateMigrationArgs{
Down: pulumi.String("string"),
Id: pulumi.String("string"),
Up: pulumi.String("string"),
},
},
})
var migrateResource = new Migrate("migrateResource", MigrateArgs.builder()
.migrations(MigrateMigrationArgs.builder()
.down("string")
.id("string")
.up("string")
.build())
.build());
migrate_resource = sql.Migrate("migrateResource", migrations=[{
"down": "string",
"id": "string",
"up": "string",
}])
const migrateResource = new sql.Migrate("migrateResource", {migrations: [{
down: "string",
id: "string",
up: "string",
}]});
type: sql:Migrate
properties:
migrations:
- down: string
id: string
up: string
Migrate 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 Migrate resource accepts the following input properties:
Outputs
All input properties are implicitly available as output properties. Additionally, the Migrate resource produces the following output properties:
- Complete
Migrations List<MigrateComplete Migration> - The completed migrations that have been run against your database. This list is used as storage to migrate down or as a trigger for downstream dependencies.
- Id string
- The provider-assigned unique ID for this managed resource.
- Complete
Migrations []MigrateComplete Migration - The completed migrations that have been run against your database. This list is used as storage to migrate down or as a trigger for downstream dependencies.
- Id string
- The provider-assigned unique ID for this managed resource.
- complete
Migrations List<MigrateComplete Migration> - The completed migrations that have been run against your database. This list is used as storage to migrate down or as a trigger for downstream dependencies.
- id String
- The provider-assigned unique ID for this managed resource.
- complete
Migrations MigrateComplete Migration[] - The completed migrations that have been run against your database. This list is used as storage to migrate down or as a trigger for downstream dependencies.
- id string
- The provider-assigned unique ID for this managed resource.
- complete_
migrations Sequence[MigrateComplete Migration] - The completed migrations that have been run against your database. This list is used as storage to migrate down or as a trigger for downstream dependencies.
- id str
- The provider-assigned unique ID for this managed resource.
- complete
Migrations List<Property Map> - The completed migrations that have been run against your database. This list is used as storage to migrate down or as a trigger for downstream dependencies.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Migrate Resource
Get an existing Migrate 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?: MigrateState, opts?: CustomResourceOptions): Migrate
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
complete_migrations: Optional[Sequence[MigrateCompleteMigrationArgs]] = None,
migrations: Optional[Sequence[MigrateMigrationArgs]] = None) -> Migrate
func GetMigrate(ctx *Context, name string, id IDInput, state *MigrateState, opts ...ResourceOption) (*Migrate, error)
public static Migrate Get(string name, Input<string> id, MigrateState? state, CustomResourceOptions? opts = null)
public static Migrate get(String name, Output<String> id, MigrateState state, CustomResourceOptions options)
resources: _: type: sql:Migrate 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.
- Complete
Migrations List<MigrateComplete Migration> - The completed migrations that have been run against your database. This list is used as storage to migrate down or as a trigger for downstream dependencies.
- Migrations
List<Migrate
Migration>
- Complete
Migrations []MigrateComplete Migration Args - The completed migrations that have been run against your database. This list is used as storage to migrate down or as a trigger for downstream dependencies.
- Migrations
[]Migrate
Migration Args
- complete
Migrations List<MigrateComplete Migration> - The completed migrations that have been run against your database. This list is used as storage to migrate down or as a trigger for downstream dependencies.
- migrations
List<Migrate
Migration>
- complete
Migrations MigrateComplete Migration[] - The completed migrations that have been run against your database. This list is used as storage to migrate down or as a trigger for downstream dependencies.
- migrations
Migrate
Migration[]
- complete_
migrations Sequence[MigrateComplete Migration Args] - The completed migrations that have been run against your database. This list is used as storage to migrate down or as a trigger for downstream dependencies.
- migrations
Sequence[Migrate
Migration Args]
- complete
Migrations List<Property Map> - The completed migrations that have been run against your database. This list is used as storage to migrate down or as a trigger for downstream dependencies.
- migrations List<Property Map>
Supporting Types
MigrateCompleteMigration, MigrateCompleteMigrationArgs
MigrateMigration, MigrateMigrationArgs
Package Details
- Repository
- sql paultyng/terraform-provider-sql
- License
- Notes
- This Pulumi package is based on the
sql
Terraform Provider.