aws.codecommit.Repository
Explore with Pulumi AI
Provides a CodeCommit Repository Resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = new aws.codecommit.Repository("test", {
repositoryName: "MyTestRepository",
description: "This is the Sample App Repository",
});
import pulumi
import pulumi_aws as aws
test = aws.codecommit.Repository("test",
repository_name="MyTestRepository",
description="This is the Sample App Repository")
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/codecommit"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := codecommit.NewRepository(ctx, "test", &codecommit.RepositoryArgs{
RepositoryName: pulumi.String("MyTestRepository"),
Description: pulumi.String("This is the Sample App Repository"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var test = new Aws.CodeCommit.Repository("test", new()
{
RepositoryName = "MyTestRepository",
Description = "This is the Sample App Repository",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.codecommit.Repository;
import com.pulumi.aws.codecommit.RepositoryArgs;
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 Repository("test", RepositoryArgs.builder()
.repositoryName("MyTestRepository")
.description("This is the Sample App Repository")
.build());
}
}
resources:
test:
type: aws:codecommit:Repository
properties:
repositoryName: MyTestRepository
description: This is the Sample App Repository
AWS KMS Customer Managed Keys (CMK)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const testKey = new aws.kms.Key("test", {
description: "test",
deletionWindowInDays: 7,
});
const test = new aws.codecommit.Repository("test", {
repositoryName: "MyTestRepository",
description: "This is the Sample App Repository",
kmsKeyId: testKey.arn,
});
import pulumi
import pulumi_aws as aws
test_key = aws.kms.Key("test",
description="test",
deletion_window_in_days=7)
test = aws.codecommit.Repository("test",
repository_name="MyTestRepository",
description="This is the Sample App Repository",
kms_key_id=test_key.arn)
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/codecommit"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/kms"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
testKey, err := kms.NewKey(ctx, "test", &kms.KeyArgs{
Description: pulumi.String("test"),
DeletionWindowInDays: pulumi.Int(7),
})
if err != nil {
return err
}
_, err = codecommit.NewRepository(ctx, "test", &codecommit.RepositoryArgs{
RepositoryName: pulumi.String("MyTestRepository"),
Description: pulumi.String("This is the Sample App Repository"),
KmsKeyId: testKey.Arn,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var testKey = new Aws.Kms.Key("test", new()
{
Description = "test",
DeletionWindowInDays = 7,
});
var test = new Aws.CodeCommit.Repository("test", new()
{
RepositoryName = "MyTestRepository",
Description = "This is the Sample App Repository",
KmsKeyId = testKey.Arn,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.kms.Key;
import com.pulumi.aws.kms.KeyArgs;
import com.pulumi.aws.codecommit.Repository;
import com.pulumi.aws.codecommit.RepositoryArgs;
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 testKey = new Key("testKey", KeyArgs.builder()
.description("test")
.deletionWindowInDays(7)
.build());
var test = new Repository("test", RepositoryArgs.builder()
.repositoryName("MyTestRepository")
.description("This is the Sample App Repository")
.kmsKeyId(testKey.arn())
.build());
}
}
resources:
test:
type: aws:codecommit:Repository
properties:
repositoryName: MyTestRepository
description: This is the Sample App Repository
kmsKeyId: ${testKey.arn}
testKey:
type: aws:kms:Key
name: test
properties:
description: test
deletionWindowInDays: 7
Create Repository Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Repository(name: string, args: RepositoryArgs, opts?: CustomResourceOptions);
@overload
def Repository(resource_name: str,
args: RepositoryArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Repository(resource_name: str,
opts: Optional[ResourceOptions] = None,
repository_name: Optional[str] = None,
default_branch: Optional[str] = None,
description: Optional[str] = None,
kms_key_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
func NewRepository(ctx *Context, name string, args RepositoryArgs, opts ...ResourceOption) (*Repository, error)
public Repository(string name, RepositoryArgs args, CustomResourceOptions? opts = null)
public Repository(String name, RepositoryArgs args)
public Repository(String name, RepositoryArgs args, CustomResourceOptions options)
type: aws:codecommit:Repository
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 RepositoryArgs
- 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 RepositoryArgs
- 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 RepositoryArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RepositoryArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RepositoryArgs
- 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 awsRepositoryResource = new Aws.CodeCommit.Repository("awsRepositoryResource", new()
{
RepositoryName = "string",
DefaultBranch = "string",
Description = "string",
KmsKeyId = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := codecommit.NewRepository(ctx, "awsRepositoryResource", &codecommit.RepositoryArgs{
RepositoryName: pulumi.String("string"),
DefaultBranch: pulumi.String("string"),
Description: pulumi.String("string"),
KmsKeyId: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var awsRepositoryResource = new Repository("awsRepositoryResource", RepositoryArgs.builder()
.repositoryName("string")
.defaultBranch("string")
.description("string")
.kmsKeyId("string")
.tags(Map.of("string", "string"))
.build());
aws_repository_resource = aws.codecommit.Repository("awsRepositoryResource",
repository_name="string",
default_branch="string",
description="string",
kms_key_id="string",
tags={
"string": "string",
})
const awsRepositoryResource = new aws.codecommit.Repository("awsRepositoryResource", {
repositoryName: "string",
defaultBranch: "string",
description: "string",
kmsKeyId: "string",
tags: {
string: "string",
},
});
type: aws:codecommit:Repository
properties:
defaultBranch: string
description: string
kmsKeyId: string
repositoryName: string
tags:
string: string
Repository Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Repository resource accepts the following input properties:
- Repository
Name string - The name for the repository. This needs to be less than 100 characters.
- Default
Branch string - The default branch of the repository. The branch specified here needs to exist.
- Description string
- The description of the repository. This needs to be less than 1000 characters
- Kms
Key stringId - The ARN of the encryption key. If no key is specified, the default
aws/codecommit
Amazon Web Services managed key is used. - Dictionary<string, string>
- Key-value map of resource tags. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- Repository
Name string - The name for the repository. This needs to be less than 100 characters.
- Default
Branch string - The default branch of the repository. The branch specified here needs to exist.
- Description string
- The description of the repository. This needs to be less than 1000 characters
- Kms
Key stringId - The ARN of the encryption key. If no key is specified, the default
aws/codecommit
Amazon Web Services managed key is used. - map[string]string
- Key-value map of resource tags. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- repository
Name String - The name for the repository. This needs to be less than 100 characters.
- default
Branch String - The default branch of the repository. The branch specified here needs to exist.
- description String
- The description of the repository. This needs to be less than 1000 characters
- kms
Key StringId - The ARN of the encryption key. If no key is specified, the default
aws/codecommit
Amazon Web Services managed key is used. - Map<String,String>
- Key-value map of resource tags. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- repository
Name string - The name for the repository. This needs to be less than 100 characters.
- default
Branch string - The default branch of the repository. The branch specified here needs to exist.
- description string
- The description of the repository. This needs to be less than 1000 characters
- kms
Key stringId - The ARN of the encryption key. If no key is specified, the default
aws/codecommit
Amazon Web Services managed key is used. - {[key: string]: string}
- Key-value map of resource tags. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- repository_
name str - The name for the repository. This needs to be less than 100 characters.
- default_
branch str - The default branch of the repository. The branch specified here needs to exist.
- description str
- The description of the repository. This needs to be less than 1000 characters
- kms_
key_ strid - The ARN of the encryption key. If no key is specified, the default
aws/codecommit
Amazon Web Services managed key is used. - Mapping[str, str]
- Key-value map of resource tags. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- repository
Name String - The name for the repository. This needs to be less than 100 characters.
- default
Branch String - The default branch of the repository. The branch specified here needs to exist.
- description String
- The description of the repository. This needs to be less than 1000 characters
- kms
Key StringId - The ARN of the encryption key. If no key is specified, the default
aws/codecommit
Amazon Web Services managed key is used. - Map<String>
- Key-value map of resource tags. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Outputs
All input properties are implicitly available as output properties. Additionally, the Repository resource produces the following output properties:
- Arn string
- The ARN of the repository
- Clone
Url stringHttp - The URL to use for cloning the repository over HTTPS.
- Clone
Url stringSsh - The URL to use for cloning the repository over SSH.
- Id string
- The provider-assigned unique ID for this managed resource.
- Repository
Id string - The ID of the repository
- Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Arn string
- The ARN of the repository
- Clone
Url stringHttp - The URL to use for cloning the repository over HTTPS.
- Clone
Url stringSsh - The URL to use for cloning the repository over SSH.
- Id string
- The provider-assigned unique ID for this managed resource.
- Repository
Id string - The ID of the repository
- map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- The ARN of the repository
- clone
Url StringHttp - The URL to use for cloning the repository over HTTPS.
- clone
Url StringSsh - The URL to use for cloning the repository over SSH.
- id String
- The provider-assigned unique ID for this managed resource.
- repository
Id String - The ID of the repository
- Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn string
- The ARN of the repository
- clone
Url stringHttp - The URL to use for cloning the repository over HTTPS.
- clone
Url stringSsh - The URL to use for cloning the repository over SSH.
- id string
- The provider-assigned unique ID for this managed resource.
- repository
Id string - The ID of the repository
- {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn str
- The ARN of the repository
- clone_
url_ strhttp - The URL to use for cloning the repository over HTTPS.
- clone_
url_ strssh - The URL to use for cloning the repository over SSH.
- id str
- The provider-assigned unique ID for this managed resource.
- repository_
id str - The ID of the repository
- Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- The ARN of the repository
- clone
Url StringHttp - The URL to use for cloning the repository over HTTPS.
- clone
Url StringSsh - The URL to use for cloning the repository over SSH.
- id String
- The provider-assigned unique ID for this managed resource.
- repository
Id String - The ID of the repository
- Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
Look up Existing Repository Resource
Get an existing Repository 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?: RepositoryState, opts?: CustomResourceOptions): Repository
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
clone_url_http: Optional[str] = None,
clone_url_ssh: Optional[str] = None,
default_branch: Optional[str] = None,
description: Optional[str] = None,
kms_key_id: Optional[str] = None,
repository_id: Optional[str] = None,
repository_name: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None) -> Repository
func GetRepository(ctx *Context, name string, id IDInput, state *RepositoryState, opts ...ResourceOption) (*Repository, error)
public static Repository Get(string name, Input<string> id, RepositoryState? state, CustomResourceOptions? opts = null)
public static Repository get(String name, Output<String> id, RepositoryState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- Arn string
- The ARN of the repository
- Clone
Url stringHttp - The URL to use for cloning the repository over HTTPS.
- Clone
Url stringSsh - The URL to use for cloning the repository over SSH.
- Default
Branch string - The default branch of the repository. The branch specified here needs to exist.
- Description string
- The description of the repository. This needs to be less than 1000 characters
- Kms
Key stringId - The ARN of the encryption key. If no key is specified, the default
aws/codecommit
Amazon Web Services managed key is used. - Repository
Id string - The ID of the repository
- Repository
Name string - The name for the repository. This needs to be less than 100 characters.
- Dictionary<string, string>
- Key-value map of resource tags. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Arn string
- The ARN of the repository
- Clone
Url stringHttp - The URL to use for cloning the repository over HTTPS.
- Clone
Url stringSsh - The URL to use for cloning the repository over SSH.
- Default
Branch string - The default branch of the repository. The branch specified here needs to exist.
- Description string
- The description of the repository. This needs to be less than 1000 characters
- Kms
Key stringId - The ARN of the encryption key. If no key is specified, the default
aws/codecommit
Amazon Web Services managed key is used. - Repository
Id string - The ID of the repository
- Repository
Name string - The name for the repository. This needs to be less than 100 characters.
- map[string]string
- Key-value map of resource tags. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- The ARN of the repository
- clone
Url StringHttp - The URL to use for cloning the repository over HTTPS.
- clone
Url StringSsh - The URL to use for cloning the repository over SSH.
- default
Branch String - The default branch of the repository. The branch specified here needs to exist.
- description String
- The description of the repository. This needs to be less than 1000 characters
- kms
Key StringId - The ARN of the encryption key. If no key is specified, the default
aws/codecommit
Amazon Web Services managed key is used. - repository
Id String - The ID of the repository
- repository
Name String - The name for the repository. This needs to be less than 100 characters.
- Map<String,String>
- Key-value map of resource tags. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn string
- The ARN of the repository
- clone
Url stringHttp - The URL to use for cloning the repository over HTTPS.
- clone
Url stringSsh - The URL to use for cloning the repository over SSH.
- default
Branch string - The default branch of the repository. The branch specified here needs to exist.
- description string
- The description of the repository. This needs to be less than 1000 characters
- kms
Key stringId - The ARN of the encryption key. If no key is specified, the default
aws/codecommit
Amazon Web Services managed key is used. - repository
Id string - The ID of the repository
- repository
Name string - The name for the repository. This needs to be less than 100 characters.
- {[key: string]: string}
- Key-value map of resource tags. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn str
- The ARN of the repository
- clone_
url_ strhttp - The URL to use for cloning the repository over HTTPS.
- clone_
url_ strssh - The URL to use for cloning the repository over SSH.
- default_
branch str - The default branch of the repository. The branch specified here needs to exist.
- description str
- The description of the repository. This needs to be less than 1000 characters
- kms_
key_ strid - The ARN of the encryption key. If no key is specified, the default
aws/codecommit
Amazon Web Services managed key is used. - repository_
id str - The ID of the repository
- repository_
name str - The name for the repository. This needs to be less than 100 characters.
- Mapping[str, str]
- Key-value map of resource tags. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- The ARN of the repository
- clone
Url StringHttp - The URL to use for cloning the repository over HTTPS.
- clone
Url StringSsh - The URL to use for cloning the repository over SSH.
- default
Branch String - The default branch of the repository. The branch specified here needs to exist.
- description String
- The description of the repository. This needs to be less than 1000 characters
- kms
Key StringId - The ARN of the encryption key. If no key is specified, the default
aws/codecommit
Amazon Web Services managed key is used. - repository
Id String - The ID of the repository
- repository
Name String - The name for the repository. This needs to be less than 100 characters.
- Map<String>
- Key-value map of resource tags. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
Import
Using pulumi import
, import CodeCommit repository using repository name. For example:
$ pulumi import aws:codecommit/repository:Repository imported ExistingRepo
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.