bitbucket.CommitFile
Explore with Pulumi AI
Commit a file.
This resource allows you to create a commit within a Bitbucket repository.
OAuth2 Scopes: repository:write
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as bitbucket from "@pulumi/bitbucket";
const test = new bitbucket.CommitFile("test", {
branch: "main",
commitAuthor: "Test <test@test.local>",
commitMessage: "test",
content: "abc",
filename: "README.md",
repoSlug: "test",
workspace: "test",
});
import pulumi
import pulumi_bitbucket as bitbucket
test = bitbucket.CommitFile("test",
branch="main",
commit_author="Test <test@test.local>",
commit_message="test",
content="abc",
filename="README.md",
repo_slug="test",
workspace="test")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/bitbucket/v2/bitbucket"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := bitbucket.NewCommitFile(ctx, "test", &bitbucket.CommitFileArgs{
Branch: pulumi.String("main"),
CommitAuthor: pulumi.String("Test <test@test.local>"),
CommitMessage: pulumi.String("test"),
Content: pulumi.String("abc"),
Filename: pulumi.String("README.md"),
RepoSlug: pulumi.String("test"),
Workspace: pulumi.String("test"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Bitbucket = Pulumi.Bitbucket;
return await Deployment.RunAsync(() =>
{
var test = new Bitbucket.CommitFile("test", new()
{
Branch = "main",
CommitAuthor = "Test <test@test.local>",
CommitMessage = "test",
Content = "abc",
Filename = "README.md",
RepoSlug = "test",
Workspace = "test",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.bitbucket.CommitFile;
import com.pulumi.bitbucket.CommitFileArgs;
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 CommitFile("test", CommitFileArgs.builder()
.branch("main")
.commitAuthor("Test <test@test.local>")
.commitMessage("test")
.content("abc")
.filename("README.md")
.repoSlug("test")
.workspace("test")
.build());
}
}
resources:
test:
type: bitbucket:CommitFile
properties:
branch: main
commitAuthor: Test <test@test.local>
commitMessage: test
content: abc
filename: README.md
repoSlug: test
workspace: test
Create CommitFile Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CommitFile(name: string, args: CommitFileArgs, opts?: CustomResourceOptions);
@overload
def CommitFile(resource_name: str,
args: CommitFileArgs,
opts: Optional[ResourceOptions] = None)
@overload
def CommitFile(resource_name: str,
opts: Optional[ResourceOptions] = None,
branch: Optional[str] = None,
commit_author: Optional[str] = None,
commit_message: Optional[str] = None,
content: Optional[str] = None,
filename: Optional[str] = None,
repo_slug: Optional[str] = None,
workspace: Optional[str] = None,
commit_file_id: Optional[str] = None)
func NewCommitFile(ctx *Context, name string, args CommitFileArgs, opts ...ResourceOption) (*CommitFile, error)
public CommitFile(string name, CommitFileArgs args, CustomResourceOptions? opts = null)
public CommitFile(String name, CommitFileArgs args)
public CommitFile(String name, CommitFileArgs args, CustomResourceOptions options)
type: bitbucket:CommitFile
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 CommitFileArgs
- 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 CommitFileArgs
- 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 CommitFileArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CommitFileArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CommitFileArgs
- 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 commitFileResource = new Bitbucket.CommitFile("commitFileResource", new()
{
Branch = "string",
CommitAuthor = "string",
CommitMessage = "string",
Content = "string",
Filename = "string",
RepoSlug = "string",
Workspace = "string",
CommitFileId = "string",
});
example, err := bitbucket.NewCommitFile(ctx, "commitFileResource", &bitbucket.CommitFileArgs{
Branch: pulumi.String("string"),
CommitAuthor: pulumi.String("string"),
CommitMessage: pulumi.String("string"),
Content: pulumi.String("string"),
Filename: pulumi.String("string"),
RepoSlug: pulumi.String("string"),
Workspace: pulumi.String("string"),
CommitFileId: pulumi.String("string"),
})
var commitFileResource = new CommitFile("commitFileResource", CommitFileArgs.builder()
.branch("string")
.commitAuthor("string")
.commitMessage("string")
.content("string")
.filename("string")
.repoSlug("string")
.workspace("string")
.commitFileId("string")
.build());
commit_file_resource = bitbucket.CommitFile("commitFileResource",
branch="string",
commit_author="string",
commit_message="string",
content="string",
filename="string",
repo_slug="string",
workspace="string",
commit_file_id="string")
const commitFileResource = new bitbucket.CommitFile("commitFileResource", {
branch: "string",
commitAuthor: "string",
commitMessage: "string",
content: "string",
filename: "string",
repoSlug: "string",
workspace: "string",
commitFileId: "string",
});
type: bitbucket:CommitFile
properties:
branch: string
commitAuthor: string
commitFileId: string
commitMessage: string
content: string
filename: string
repoSlug: string
workspace: string
CommitFile 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 CommitFile resource accepts the following input properties:
- Branch string
- Git branch.
- string
- Committer author to use.
- Commit
Message string - The message of the commit.
- Content string
- The file content.
- Filename string
- The path of the file to manage.
- Repo
Slug string - The repository slug.
- Workspace string
- The workspace id.
- Commit
File stringId
- Branch string
- Git branch.
- string
- Committer author to use.
- Commit
Message string - The message of the commit.
- Content string
- The file content.
- Filename string
- The path of the file to manage.
- Repo
Slug string - The repository slug.
- Workspace string
- The workspace id.
- Commit
File stringId
- branch String
- Git branch.
- String
- Committer author to use.
- commit
Message String - The message of the commit.
- content String
- The file content.
- filename String
- The path of the file to manage.
- repo
Slug String - The repository slug.
- workspace String
- The workspace id.
- commit
File StringId
- branch string
- Git branch.
- string
- Committer author to use.
- commit
Message string - The message of the commit.
- content string
- The file content.
- filename string
- The path of the file to manage.
- repo
Slug string - The repository slug.
- workspace string
- The workspace id.
- commit
File stringId
- branch str
- Git branch.
- str
- Committer author to use.
- commit_
message str - The message of the commit.
- content str
- The file content.
- filename str
- The path of the file to manage.
- repo_
slug str - The repository slug.
- workspace str
- The workspace id.
- commit_
file_ strid
- branch String
- Git branch.
- String
- Committer author to use.
- commit
Message String - The message of the commit.
- content String
- The file content.
- filename String
- The path of the file to manage.
- repo
Slug String - The repository slug.
- workspace String
- The workspace id.
- commit
File StringId
Outputs
All input properties are implicitly available as output properties. Additionally, the CommitFile resource produces the following output properties:
- commit_
sha str - The SHA of the commit that modified the file
- id str
- The provider-assigned unique ID for this managed resource.
Look up Existing CommitFile Resource
Get an existing CommitFile 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?: CommitFileState, opts?: CustomResourceOptions): CommitFile
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
branch: Optional[str] = None,
commit_author: Optional[str] = None,
commit_file_id: Optional[str] = None,
commit_message: Optional[str] = None,
commit_sha: Optional[str] = None,
content: Optional[str] = None,
filename: Optional[str] = None,
repo_slug: Optional[str] = None,
workspace: Optional[str] = None) -> CommitFile
func GetCommitFile(ctx *Context, name string, id IDInput, state *CommitFileState, opts ...ResourceOption) (*CommitFile, error)
public static CommitFile Get(string name, Input<string> id, CommitFileState? state, CustomResourceOptions? opts = null)
public static CommitFile get(String name, Output<String> id, CommitFileState state, CustomResourceOptions options)
resources: _: type: bitbucket:CommitFile 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.
- Branch string
- Git branch.
- string
- Committer author to use.
- Commit
File stringId - Commit
Message string - The message of the commit.
- Commit
Sha string - The SHA of the commit that modified the file
- Content string
- The file content.
- Filename string
- The path of the file to manage.
- Repo
Slug string - The repository slug.
- Workspace string
- The workspace id.
- Branch string
- Git branch.
- string
- Committer author to use.
- Commit
File stringId - Commit
Message string - The message of the commit.
- Commit
Sha string - The SHA of the commit that modified the file
- Content string
- The file content.
- Filename string
- The path of the file to manage.
- Repo
Slug string - The repository slug.
- Workspace string
- The workspace id.
- branch String
- Git branch.
- String
- Committer author to use.
- commit
File StringId - commit
Message String - The message of the commit.
- commit
Sha String - The SHA of the commit that modified the file
- content String
- The file content.
- filename String
- The path of the file to manage.
- repo
Slug String - The repository slug.
- workspace String
- The workspace id.
- branch string
- Git branch.
- string
- Committer author to use.
- commit
File stringId - commit
Message string - The message of the commit.
- commit
Sha string - The SHA of the commit that modified the file
- content string
- The file content.
- filename string
- The path of the file to manage.
- repo
Slug string - The repository slug.
- workspace string
- The workspace id.
- branch str
- Git branch.
- str
- Committer author to use.
- commit_
file_ strid - commit_
message str - The message of the commit.
- commit_
sha str - The SHA of the commit that modified the file
- content str
- The file content.
- filename str
- The path of the file to manage.
- repo_
slug str - The repository slug.
- workspace str
- The workspace id.
- branch String
- Git branch.
- String
- Committer author to use.
- commit
File StringId - commit
Message String - The message of the commit.
- commit
Sha String - The SHA of the commit that modified the file
- content String
- The file content.
- filename String
- The path of the file to manage.
- repo
Slug String - The repository slug.
- workspace String
- The workspace id.
Package Details
- Repository
- bitbucket drfaust92/terraform-provider-bitbucket
- License
- Notes
- This Pulumi package is based on the
bitbucket
Terraform Provider.