Skip to content

Commit

Permalink
update repo
Browse files Browse the repository at this point in the history
  • Loading branch information
jyecusch committed Aug 7, 2024
1 parent 363fcb6 commit 5b8165e
Show file tree
Hide file tree
Showing 52 changed files with 967 additions and 489 deletions.
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ PROJECT_NAME := Pulumi awstags Resource Provider

PACK := awstags
PACKDIR := sdk
PROJECT := github.com/jyecusch/pulumi-awstags-native
NODE_MODULE_NAME := @nitric/awstags
NUGET_PKG_NAME := nitric.awstags
PROJECT := github.com/nitrictech/pulumi-awstags-native
NODE_MODULE_NAME := @nitric/pulumi-awstags
NUGET_PKG_NAME := nitric.pulumi-awstags

PROVIDER := pulumi-resource-${PACK}
VERSION ?= $(shell pulumictl get version)
PROVIDER_PATH := provider
VERSION_PATH := ${PROVIDER_PATH}.Version
# VERSION_PATH := ${PROVIDER_PATH}.Version
VERSION_PATH := main.Version

GOPATH := $(shell go env GOPATH)

Expand Down Expand Up @@ -46,7 +47,7 @@ ensure::
cd tests && go mod tidy

provider::
(cd provider && go build -o $(WORKING_DIR)/bin/${PROVIDER} -ldflags "-X ${PROJECT}/${VERSION_PATH}=${VERSION}" $(PROJECT)/${PROVIDER_PATH}/cmd/$(PROVIDER))
(cd provider && go build -o $(WORKING_DIR)/bin/${PROVIDER} -ldflags "-X ${VERSION_PATH}=${VERSION}" $(PROJECT)/${PROVIDER_PATH}/cmd/$(PROVIDER))

provider_debug::
(cd provider && go build -o $(WORKING_DIR)/bin/${PROVIDER} -gcflags="all=-N -l" -ldflags "-X ${PROJECT}/${VERSION_PATH}=${VERSION}" $(PROJECT)/${PROVIDER_PATH}/cmd/$(PROVIDER))
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This repository is a boilerplate showing how to create and locally test a native

## Authoring a Pulumi Native Provider

This boilerplate creates a working Pulumi-owned provider named `awstags`.
This boilerplate creates a working Pulumi-owned provider named `pulumi-awstags`.
It implements a random number generator that you can [build and test out for yourself](#test-against-the-example) and then replace the Random code with code specific to your provider.


Expand Down Expand Up @@ -57,7 +57,7 @@ From the templated repository:
- replace dependencies in `provider/go.mod` to reflect your repository name
- find and replace all instances of the boilerplate `awstags` with the `NAME` of your provider.
- find and replace all instances of the boilerplate `nitric` with the `ORG` of your provider.
- replace all instances of the `github.com/jyecusch/pulumi-awstags-native` repository with the `REPOSITORY` location
- replace all instances of the `github.com/nitrictech/pulumi-awstags-native` repository with the `REPOSITORY` location

#### Build the provider and install the plugin

Expand Down
2 changes: 1 addition & 1 deletion examples/nodejs/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as pulumi from "@pulumi/pulumi";
import * as awstags from "@pulumi/awstags";
import * as awstags from "@nitric/awstags";

const myRandomResource = new awstags.Random("myRandomResource", {length: 24});
export const output = {
Expand Down
2 changes: 1 addition & 1 deletion examples/nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"dependencies": {
"typescript": "^4.0.0",
"@pulumi/pulumi": "^3.0.0",
"@pulumi/awstags": "0.0.1-alpha.1722572321+80cfe413.dirty"
"@nitric/pulumi-awstags": "0.0.1-alpha.1722572321+80cfe413.dirty"
}
}
5 changes: 4 additions & 1 deletion provider/cmd/pulumi-resource-awstags/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ package main
import (
p "github.com/pulumi/pulumi-go-provider"

awstags "github.com/jyecusch/pulumi-awstags-native/provider/pkg"
awstags "github.com/nitrictech/pulumi-awstags-native/provider/pkg"
)

// Version is initialized by the Go linker to contain the semver of this build.
var Version string

// Serve the provider against Pulumi's Provider protocol.
func main() { p.RunProvider(awstags.Name, awstags.Version, awstags.Provider()) }
2 changes: 1 addition & 1 deletion provider/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/jyecusch/pulumi-awstags-native/provider
module github.com/nitrictech/pulumi-awstags-native/provider

go 1.21

Expand Down
2 changes: 1 addition & 1 deletion provider/pkg/aws/tagresources.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi"
"github.com/jyecusch/pulumi-awstags-native/provider/pkg/mutex"
"github.com/nitrictech/pulumi-awstags-native/provider/pkg/mutex"
p "github.com/pulumi/pulumi-go-provider"
"golang.org/x/time/rate"
)
Expand Down
33 changes: 32 additions & 1 deletion provider/pkg/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
package provider

import (
"github.com/jyecusch/pulumi-awstags-native/provider/pkg/aws"
"fmt"

"github.com/nitrictech/pulumi-awstags-native/provider/pkg/aws"
p "github.com/pulumi/pulumi-go-provider"
"github.com/pulumi/pulumi-go-provider/infer"
"github.com/pulumi/pulumi-go-provider/middleware/schema"
"github.com/pulumi/pulumi/sdk/v3/go/common/tokens"
)

Expand All @@ -35,5 +38,33 @@ func Provider() p.Provider {
ModuleMap: map[tokens.ModuleName]tokens.ModuleName{
"provider": "index",
},
Metadata: schema.Metadata{
Description: "The AWS tags provider enables you to manage tags on already deployed or imported AWS resources.",
DisplayName: "Aws Tags",
Keywords: []string{
"pulumi",
"awstags",
"kind/native",
},
Homepage: "https://github.com/nitrictech/pulumi-awstags",
Repository: "https://github.com/nitrictech/pulumi-awstags",
Publisher: "Nitric",
LogoURL: "",
License: "MIT",
PluginDownloadURL: fmt.Sprintf("https://github.com/nitrictech/pulumi-awstags/releases/download/v%s/pulumi-awstags-v%s.tgz", Version, Version),
LanguageMap: map[string]any{
"nodejs": map[string]any{
"packageName": "@nitric/pulumi-awstags",
"packageDescription": "A pulumi provider that manages awstags resources",
"dependencies": map[string]string{
"@pulumi/pulumi": "^3.0.0",
},
},
"go": map[string]any{
"generateResourceContainerTypes": true,
"importBasePath": "github.com/nitrictech/pulumi-awstags/sdk/v3/go/awstags",
},
},
},
})
}
20 changes: 20 additions & 0 deletions sdk/dotnet/Aws/Inputs/TagArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// *** WARNING: this file was generated by pulumi. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;

namespace Pulumi.Awstags.Aws.Inputs
{

public sealed class TagArgs : global::Pulumi.ResourceArgs
{
public TagArgs()
{
}
public static new TagArgs Empty => new TagArgs();
}
}
21 changes: 21 additions & 0 deletions sdk/dotnet/Aws/Outputs/Tag.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// *** WARNING: this file was generated by pulumi. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;

namespace Pulumi.Awstags.Aws.Outputs
{

[OutputType]
public sealed class Tag
{
[OutputConstructor]
private Tag()
{
}
}
}
1 change: 1 addition & 0 deletions sdk/dotnet/Aws/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The AWS tags provider enables you to manage tags on already deployed or imported AWS resources.
78 changes: 78 additions & 0 deletions sdk/dotnet/Aws/ResourceTag.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// *** WARNING: this file was generated by pulumi. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;

namespace Pulumi.Awstags.Aws
{
[AwstagsResourceType("awstags:aws:ResourceTag")]
public partial class ResourceTag : global::Pulumi.CustomResource
{
[Output("resourceARN")]
public Output<string> ResourceARN { get; private set; } = null!;

[Output("tag")]
public Output<Outputs.Tag> Tag { get; private set; } = null!;


/// <summary>
/// Create a ResourceTag resource with the given unique name, arguments, and options.
/// </summary>
///
/// <param name="name">The unique name of the resource</param>
/// <param name="args">The arguments used to populate this resource's properties</param>
/// <param name="options">A bag of options that control this resource's behavior</param>
public ResourceTag(string name, ResourceTagArgs args, CustomResourceOptions? options = null)
: base("awstags:aws:ResourceTag", name, args ?? new ResourceTagArgs(), MakeResourceOptions(options, ""))
{
}

private ResourceTag(string name, Input<string> id, CustomResourceOptions? options = null)
: base("awstags:aws:ResourceTag", name, null, MakeResourceOptions(options, id))
{
}

private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
{
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "https://github.com/nitrictech/pulumi-awstags/releases/download/v/pulumi-awstags-v.tgz",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
merged.Id = id ?? merged.Id;
return merged;
}
/// <summary>
/// Get an existing ResourceTag resource's state with the given name, ID, and optional extra
/// properties used to qualify the lookup.
/// </summary>
///
/// <param name="name">The unique name of the resulting resource.</param>
/// <param name="id">The unique provider ID of the resource to lookup.</param>
/// <param name="options">A bag of options that control this resource's behavior</param>
public static ResourceTag Get(string name, Input<string> id, CustomResourceOptions? options = null)
{
return new ResourceTag(name, id, options);
}
}

public sealed class ResourceTagArgs : global::Pulumi.ResourceArgs
{
[Input("resourceARN", required: true)]
public Input<string> ResourceARN { get; set; } = null!;

[Input("tag", required: true)]
public Input<Inputs.TagArgs> Tag { get; set; } = null!;

public ResourceTagArgs()
{
}
public static new ResourceTagArgs Empty => new ResourceTagArgs();
}
}
1 change: 1 addition & 0 deletions sdk/dotnet/Provider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "https://github.com/nitrictech/pulumi-awstags/releases/download/v/pulumi-awstags-v.tgz",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
12 changes: 6 additions & 6 deletions sdk/dotnet/Pulumi.Awstags.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

<PropertyGroup>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>Pulumi Corp.</Authors>
<Company>Pulumi Corp.</Company>
<Description></Description>
<PackageLicenseExpression></PackageLicenseExpression>
<PackageProjectUrl></PackageProjectUrl>
<RepositoryUrl></RepositoryUrl>
<Authors>Nitric</Authors>
<Company>Nitric</Company>
<Description>The AWS tags provider enables you to manage tags on already deployed or imported AWS resources.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/nitrictech/pulumi-awstags</PackageProjectUrl>
<RepositoryUrl>https://github.com/nitrictech/pulumi-awstags</RepositoryUrl>
<PackageIcon>logo.png</PackageIcon>

<TargetFramework>net6.0</TargetFramework>
Expand Down
1 change: 1 addition & 0 deletions sdk/dotnet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The AWS tags provider enables you to manage tags on already deployed or imported AWS resources.
74 changes: 0 additions & 74 deletions sdk/dotnet/Random.cs

This file was deleted.

1 change: 1 addition & 0 deletions sdk/dotnet/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ static class Utilities
{
var dst = src ?? new global::Pulumi.InvokeOptions{};
dst.Version = src?.Version ?? Version;
dst.PluginDownloadURL = src?.PluginDownloadURL ?? "https://github.com/nitrictech/pulumi-awstags/releases/download/v/pulumi-awstags-v.tgz";
return dst;
}

Expand Down
3 changes: 2 additions & 1 deletion sdk/dotnet/pulumi-plugin.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"resource": true,
"name": "awstags"
"name": "awstags",
"server": "https://github.com/nitrictech/pulumi-awstags/releases/download/v/pulumi-awstags-v.tgz"
}
2 changes: 1 addition & 1 deletion sdk/dotnet/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.1-alpha.1722572321+80cfe413.dirty
0.0.1-alpha.1722997540+363fcb6e.dirty
Loading

0 comments on commit 5b8165e

Please sign in to comment.