Custom domain args exposing https settings for c#

xyz Pulumi Component Provider (TypeScript)

This repo is a boilerplate showing how to create a Pulumi component provider written in TypeScript. You can search-replace xyz with the name of your desired provider as a starting point for creating a component provider for your component resources.

An example StaticPage component resource is available in provider/cmd/pulumi-resource-xyz/staticPage.ts. This component creates a static web page hosted in an AWS S3 Bucket. There is nothing special about StaticPage -- it is a typical component resource written in TypeScript.

The component provider makes component resources available to other languages. The implementation is in provider/cmd/pulumi-resource-xyz/provider.ts. Each component resource in the provider must have an implementation in the construct method to create an instance of the requested component resource and return its URN and state (outputs). There is an initial implementation that demonstrates an implementation of construct for the example StaticPage component.

A code generator is available which generates SDKs in TypeScript, Python, Go and .NET which are also checked in to the sdk folder. The SDKs are generated from a schema in schema.json. This file should be kept aligned with the component resources supported by the component provider implementation.

An example of using the StaticPage component in TypeScript is in examples/simple.

Note that the provider plugin (pulumi-resource-xyz) must be on your PATH to be used by Pulumi deployments. In this case, pulumi-resource-xyz is a platform-specific binary that includes its Node.js dependency along with the provider code, created using nexe. By default, running make install will create the binary specific to your host environment, but you can override the binary target by passing in make install target= where target-string is a valid nexe target.

After running make install, pulumi-resource-xyz will be available in the ./bin directory. You can add this to your path in bash with export PATH=$PATH:$PWD/bin.

If creating a provider for distribution to other users, they will need pulumi-resource-xyz directory on their PATH. See the Packaging section below for more on distributing the provider to users.

Prerequisites

  • Pulumi CLI
  • Node.js
  • Yarn
  • Go 1.15 (to regenerate the SDKs)
  • Python 3.6+ (to build the Python SDK)
  • .NET Core SDK (to build the .NET SDK)

Build and Test

# Build and install the provider
make install_provider

# Regenerate SDKs
make generate

# Ensure the pulumi-provider-xyz script is on PATH
$ export PATH=$PATH:$PWD/bin

# Test Node.js SDK
$ make install_nodejs_sdk
$ cd examples/simple
$ yarn install
$ yarn link @pulumi/xyz
$ pulumi stack init test
$ pulumi config set aws:region us-east-1
$ pulumi up

Naming

The xyz provider's plugin must be named pulumi-resource-xyz (in the format pulumi-resource- ).

While the provider plugin must follow this naming convention, the SDK package naming can be customized. TODO explain.

Packaging

The provider plugin can be packaged into a tarball and hosted at a custom server URL to make it easier to distribute to users.

Currently, three tarball files are necessary for Linux, macOS, and Windows (pulumi-resource-xyz-v0.0.1-linux-amd64.tar.gz, pulumi-resource-xyz-v0.0.1-darwin-amd64.tar.gz, pulumi-resource-xyz-v0.0.1-windows-amd64.tar.gz) each containing the same file: the platform-specific binary pulumi-resource-xyz created in the ./bin directory after running make install_provider. These artifacts can be generated automatically in the dist directory using make dist.

TODO explain custom server hosting in more detail.

Example component

Let's look at the example StaticPage component resource in more detail.

Schema

The example StaticPage component resource is defined in schema.json:

"resources": {
    "xyz:index:StaticPage": {
        "isComponent": true,
        "inputProperties": {
            "indexContent": {
                "type": "string",
                "description": "The HTML content for index.html."
            }
        },
        "requiredInputs": [
            "indexContent"
        ],
        "properties": {
            "bucket": {
                "$ref": "/aws/v3.30.0/schema.json#/resources/aws:s3%2Fbucket:Bucket",
                "description": "The bucket resource."
            },
            "websiteUrl": {
                "type": "string",
                "description": "The website URL."
            }
        },
        "required": [
            "bucket",
            "websiteUrl"
        ]
    }
}

The component resource's type token is xyz:index:StaticPage in the format of : : . In this case, it's in the xyz package and index module. This is the same type token passed inside the implementation of StaticPage in provider/cmd/pulumi-resource-xyz/staticPage.ts, and also the same token referenced in construct in provider/cmd/pulumi-resource-xyz/provider.ts.

This component has a required indexContent input property typed as string, and two required output properties: bucket and websiteUrl. Note that bucket is typed as the aws:s3/bucket:Bucket resource from the aws provider (in the schema the / is escaped as %2F).

Since this component returns a type from the aws provider, each SDK must reference the associated Pulumi aws SDK for the language. For the .NET, Node.js, and Python SDKs, dependencies are specified in the language section of the schema:

=2.21.2,<3.0.0", "pulumi-aws": ">=3.30.0,<4.0.0" } } } ">
"language": {
    "csharp": {
        "packageReferences": {
            "Pulumi": "2.*",
            "Pulumi.Aws": "3.*"
        }
    },
    "nodejs": {
        "dependencies": {
            "@pulumi/aws": "^3.30.0"
        },
        "devDependencies": {
            "typescript": "^3.7.0"
        }
    },
    "python": {
        "requires": {
            "pulumi": ">=2.21.2,<3.0.0",
            "pulumi-aws": ">=3.30.0,<4.0.0"
        }
    }
}

For the Go SDK, dependencies are specified in the sdk/go.mod file.

Implementation

The implementation of this component is in provider/cmd/pulumi-resource-xyz/staticPage.ts and the structure of the component's inputs and outputs aligns with what is defined in schema.json:

export interface StaticPageArgs {
    indexContent: pulumi.Input<string>;
}

export class StaticPage extends pulumi.ComponentResource {
    public readonly bucket: aws.s3.Bucket;
    public readonly websiteUrl: pulumi.Output<string>;

    constructor(name: string, args: StaticPageArgs, opts?: pulumi.ComponentResourceOptions) {
        super("xyz:index:StaticPage", name, args, opts);

        ...
    }
}

The provider makes this component resource available in the construct method in provider/cmd/pulumi-resource-xyz/provider.ts. When construct is called and the type argument is xyz:index:StaticPage, we create an instance of the StaticPage component resource and return its URN and outputs as its state.

async function constructStaticPage(name: string, inputs: pulumi.Inputs,
    options: pulumi.ComponentResourceOptions): Promise<provider.ConstructResult> {

    // Create the component resource.
    const staticPage = new StaticPage(name, inputs as StaticPageArgs, options);

    // Return the component resource's URN and outputs as its state.
    return {
        urn: staticPage.urn,
        state: {
            bucket: staticPage.bucket,
            websiteUrl: staticPage.websiteUrl,
        },
    };
}
Similar Resources

for Prometheus, complex settings

Remo Manager Nature Remo Cloud API を用いて、Prometheus上にデータを展開するプログラム。 Nature Remo Cloud APIのアクセスリミットに対応し、1分間に1度だけデータを更新する。 使い方 make build - docker-compo

Dec 29, 2021

Simple tool to test SMTP mail send with various settings including TLS1.1 downgrade

smtptest Simple tool to test SMTP mail send with various settings including TLS1.1 downgrade All settings are configurable in the config.yaml file ser

Sep 19, 2022

Anybool - Useful interface for boolean settings and options

anybool Tricky and fun utilities for Go programs. AnyBool is a small utility wit

Feb 2, 2022

Configmanager - Package used for retrieving application settings from various sources

Config Manager Package used for retrieving application settings from various sou

Nov 28, 2022

Kubernetes OS Server - Kubernetes Extension API server exposing OS configuration like sysctl via Kubernetes API

KOSS is a Extension API Server which exposes OS properties and functionality using Kubernetes API, so it can be accessed using e.g. kubectl. At the moment this is highly experimental and only managing sysctl is supported. To make things actually usable, you must run KOSS binary as root on the machine you will be managing.

May 19, 2021

Helper sidecar for exposing Prometheus metrics as service

metrics-server-go Helper sidecar service for exposing prometheus metrics. Application expose endpoints to update defined metrics. Whats inside? The se

Feb 3, 2022

Simple Go/Chi powered http server meant for ad hoc use such as exposing a file system for testing HTML.

httphere httphere is a simple Go/Chi powered http server for ad hoc use such as testing HTML or temporarily exposing a local file system at the curren

Dec 10, 2021

A wrapper for exposing a shared endpoint for Google Cloud Functions in go. API styled after Node.JS firebase-functions package.

firebase-fx A wrapper for Google Cloud Functions that simplifies the deployment of serverless applications. Meant to expose a similar API to the Fireb

Nov 7, 2022

Netstat exporter - Prometheus exporter for exposing reserved ports and it's mapped process

Netstat exporter Prometheus exporter for exposing reserved ports and it's mapped

Feb 3, 2022

This repo contains a sample app exposing a gRPC health endpoint to demo Kubernetes gRPC probes.

This repo contains a sample app exposing a health endpoint by implementing grpc_health_v1. Usecase is to demo the gRPC readiness and liveness probes introduced in Kubernetes 1.23.

Feb 9, 2022

An easy-to-use net tool for exposing local service to public.

An easy-to-use net tool for exposing local service to public.

gexpose An easy-to-use net tool for exposing local service to public. 一款简单易用的内网穿透工具 Architecture Usage Usage of ./gexpose: -server server mo

Nov 7, 2022

Go package exposing a simple interface for executing commands, enabling easy mocking and wrapping of executed commands.

go-runner Go package exposing a simple interface for executing commands, enabling easy mocking and wrapping of executed commands. The Runner interface

Oct 18, 2022

*DEPRECATED* Please use https://gopkg.in/redsync.v1 (https://github.com/go-redsync/redsync)

Redsync.go This package is being replaced with https://gopkg.in/redsync.v1. I will continue to maintain this package for a while so that its users do

Nov 20, 2022

llb - It's a very simple but quick backend for proxy servers. Can be useful for fast redirection to predefined domain with zero memory allocation and fast response.

llb What the f--k it is? It's a very simple but quick backend for proxy servers. You can setup redirect to your main domain or just show HTTP/1.1 404

Sep 27, 2022

Simple application written in Go that combines two wordlists and a list of TLDs to form domain names and check if they are already registered.

Domainerator Domainerator was my first Go application. It combines two wordlists (prefixes and suffixes) and a list of TLDs to form domain names and c

Sep 16, 2022

GRONG is a DNS (Domain Name System) authoritative name server.It is more a research project than a production-ready program.

GRONG (Gross and ROugh Nameserver written in Go) is a DNS (Domain Name System) authoritative name server. It is intended as a research project and is

Oct 17, 2020

A template for creating new Golang + Docker + Canonical Domain + Badges + Renovate + Golangci + Goreleaser + CircleCI + ...

A template for creating new Golang + Docker + Canonical Domain + Badges + Renovate + Golangci + Goreleaser + CircleCI + ...

golang-repo-template 😄 golang-repo-template Usage foo@bar:~$ golang-repo-template hello world _

Dec 29, 2022

Go microservice tutorial project using Domain Driven Design and Hexagonal Architecture!

"ToDo API" Microservice Example Introduction Welcome! 👋 This is an educational repository that includes a microservice written in Go. It is used as t

Jan 4, 2023

gdn is a Go module to get domain name from SSL certificates given an IP address

Get Domain Name gdn is a Go module to get domain name from SSL certificates given an IP address Installation Instructions From Source gdn requires go1

Nov 9, 2022
Tiny-HTTPS protocol implementation (experiment purpose.)

thttps Basic TLS implementation in Go, written as a learning project. Most components are forked from Go version 1.7 tiny-HTTPS is not suitable for re

Mar 7, 2022
An HTTP/HTTPS intercept proxy written in Go.
An HTTP/HTTPS intercept proxy written in Go.

Broxy Broxy is an open source intercept proxy written in Go. It makes use of goproxy as core proxy implementation and the interface is implemented wit

Nov 29, 2022
Go cmd util that prints cmd-line args with their index

echoidx This is an exercise of the book The Go Programming Language, by Alan A.

Dec 18, 2021
It‘s a cmd-line tool like `make` and `task`, supporting nested args and alias using `cobra`

It‘s a cmd-line tool like `make` and `task`, supporting nested args and alias using `cobra`. It's a makefile alternative and a shell wrapper.

Oct 18, 2022
🎯 ENS (.eth domain) batch domain resolver

ENS batch domain resolver (.eth domain) A simple program to check a batch of ENS domains availability. Configure Configs store in config.yaml file nex

Mar 15, 2022
A tool to solve DNS pollution of GitHub website. Query the real IP address of domain names such as github.com, and refresh the domain name setting of the system hosts file.

githubDNS Target A tool to solve DNS pollution of GitHub website. Query the real IP address of domain names such as github.com, and refresh the domain

Oct 14, 2021
JPRQ Customizer is a customizer that helps to use the JPRQ server code and make it compatible with your own server with custom subdomain and domain
JPRQ Customizer is a customizer that helps to use the JPRQ server code and make it compatible with your own server with custom subdomain and domain

JPRQ Customizer is a customizer that helps to use the JPRQ server code and make it compatible with your own server with custom subdomain and domain.You can upload the generated directory to your web server and expose user localhost to public internet. You can use this to make your local machine a command center for your ethical hacking purpose ;)

Jan 19, 2022
Optimize Windows's network/NIC driver settings for NewTek's NDI(Network-Device-Interface).

windows-ndi-optimizer[WIP] Optimize Windows's network/NIC driver settings for NewTek's NDI(Network-Device-Interface). How it works This is batchfile d

Apr 15, 2022
A CLI tool to change monitor settings over USB to the Gigabyte M32U

Gigabyte Monitor control Introduction A CLI tool to change monitor settings over USB to the Gigabyte M32U Supported monitors Gigabyte M32U In theory a

Dec 30, 2022
A simple CLI app to update dynamic DNS settings for your CloudFlare account

Cloudflare Dynamic DNS Updater (Go) written by Darren Rambaud Why? A simple CLI app to update dynamic DNS settings for your CloudFlare account. Useful

Nov 28, 2021