This repository has been archived by the owner on Jul 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Java blog (to may 4th) (#44) * Java blog * First round of reviews * New meta and small fixes * Add workshop link * Mention other JVM languages * Add Puluminaries launch blog (#57) Signed-off-by: Matt Stratton <[email protected]> Co-authored-by: Christian Nunciato <[email protected]> * Add Pulumi Service Provider Blog Post (#49) * add pulumi service provider blog post * fix lint errors * Update meta.png * Github --> GitHub * Apply suggestions from code review Co-authored-by: meagancojocar <[email protected]> * fix lint errors * apply wording updates from meagan * update registry link to plain md relative link * Update themes/default/content/blog/announcing-pulumi-service-provider/index.md Co-authored-by: Luke Hoban <[email protected]> * Update themes/default/content/blog/announcing-pulumi-service-provider/index.md Co-authored-by: Luke Hoban <[email protected]> * type --> teamType * remove checkout yaml comment * add teams image and blurb about rest api * Update themes/default/content/blog/announcing-pulumi-service-provider/index.md Co-authored-by: meagancojocar <[email protected]> * resize meta.png and remove paragraph * reduce meta.png even further Co-authored-by: meagancojocar <[email protected]> Co-authored-by: Luke Hoban <[email protected]> * Overview, YAML and CDK blogs (#58) * awsx blog (#59) * Fix up links and times. * Use propoer note style. * Remove accidental .gitignore changes * Add Go example * Add PR links, update banner, and pulumiup page (#53) * Add PR links, update banner, and pulumiup page * Update banner URL * Remove relref for clean build * Update themes/default/content/blog/pulumi-universal-iac/index.md Co-authored-by: Mikhail Shilkov <[email protected]> Co-authored-by: Matt Stratton <[email protected]> Co-authored-by: Myles Haynes <[email protected]> Co-authored-by: meagancojocar <[email protected]> Co-authored-by: Luke Hoban <[email protected]> Co-authored-by: Zack Chase <[email protected]>
- Loading branch information
1 parent
728998b
commit c74dd39
Showing
33 changed files
with
2,331 additions
and
31 deletions.
There are no files selected for viewing
134 changes: 134 additions & 0 deletions
134
...lt/content/blog/announcing-infrastructure-as-code-with-java-and-pulumi/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
--- | ||
title: "Announcing Infrastructure as Code with Java and Pulumi" | ||
date: 2022-05-04T06:59:00-07:00 | ||
draft: false | ||
meta_desc: Learn about Pulumi's new support for Java and JVM languages, which enable you to use infrastructure as code on any cloud with the JVM ecosystem. | ||
meta_image: meta.png | ||
authors: | ||
- mikhail-shilkov | ||
tags: | ||
- java | ||
- cloud-engineering | ||
- infrastructure-as-code | ||
--- | ||
|
||
Today we are excited to announce the preview of Java support for all of your modern infrastructure as code needs. This announcement means that you can build, deploy, and manage your infrastructure, on any cloud—including all of AWS, Azure, Google Cloud, Kubernetes, Oracle Cloud, and more—using Java and other JVM languages. This brings the entire cloud to your fingertips without ever having to leave your code editor, while using production-ready infrastructure as code techniques. | ||
|
||
<!--more--> | ||
|
||
Infrastructure has become a core part of application development as modern cloud capabilities such as microservices, containers, serverless, and data stores define your application's architecture. The term "infrastructure" covers all of the cloud resources your application needs to run. Modern architectures require thinking deeply about infrastructure while building your application, instead of treating it as an afterthought. Pulumi's approach helps developers, infrastructure engineers, and platform teams work together to leverage everything the modern cloud has to offer. | ||
|
||
Pulumi has worked with hundreds of companies to get cloud applications into production, and Java has quickly risen to become one of the most frequently requested features by the community. Today we are thrilled to make Pulumi for Java available for your cloud engineering needs. | ||
|
||
Pulumi is an open source product, and we are grateful to our awesome community members who bootstrapped Pulumi for Java last year and were instrumental in helping us with this public preview. Thank you to [Paweł Prażak](https://twitter.com/pawelprazak) and his [VirtusLab](https://virtuslab.com) colleagues! | ||
|
||
## What is Pulumi? | ||
|
||
Pulumi lets you build, deploy, and manage infrastructure on any cloud using general-purpose programming languages (TypeScript, Python, Go, .NET, Java) and markup languages (YAML, CUE) to express your application's infrastructure needs, using a powerful technique called "infrastructure as code." You declare desired infrastructure, and an engine provisions it for you, so that it's automated, easy to replicate, and robust enough for demanding production requirements. Pulumi takes this approach a step further by leveraging programming languages and software engineering tools to make modern cloud infrastructure patterns, such as containers and serverless programs, easy and first-class citizens. | ||
|
||
With Pulumi for Java you can: | ||
|
||
- **Declare infrastructure** using programs, classes, and libraries written in Java or other JVM languages (Kotlin, Scala, Clojure, Groovy, etc.). | ||
|
||
- **Automatically create, update, or delete cloud resources** using Pulumi's infrastructure as code engine, removing manual point-and-clicking in web consoles and ad-hoc scripts. | ||
|
||
- **Use your favorite IDEs and tools**, including IntelliJ IDEA and Visual Studio Code, taking advantage of features like auto-completion, refactoring, and interactive documentation. | ||
|
||
- **Catch mistakes early on** with standard compiler errors, analyzers, and an infrastructure-specific policy engine for enforcing security, compliance, and best practices. | ||
|
||
- **Reuse any existing Java package**, or distribute your own, whether that's for infrastructure best practices, productivity, or just general programming patterns. | ||
|
||
- **Deploy continuously, predictably, and reliably** using GitHub Actions, or one of over a dozen CI integrations. | ||
|
||
- **Build scalable cloud applications** using cloud native technologies like Kubernetes, Docker containers, serverless functions, and PaaS services into your core development experience, bringing them closer to your application code. | ||
|
||
Pulumi's free open source SDK, which includes a CLI and an assortment of libraries, enables these capabilities. | ||
|
||
## Example: Provision a GKE cluster with a Kubernetes namespace | ||
|
||
The following Java snippet demonstrates the power of Pulumi for Java ([full source code](https://github.com/pulumi/pulumi-java/blob/main/tests/examples/gcp-java-gke-hello-world/)). The program defines a Google Kubernetes Engine cluster, calculates its `kubeconfig` and exports it for user's needs, and deploys a Kubernetes namespace into the newly provisioned cluster. | ||
|
||
```java | ||
package gke_sample; | ||
|
||
import java.util.*; | ||
import java.io.*; | ||
import java.nio.*; | ||
import com.pulumi.*; | ||
import com.pulumi.gcp.container.*; | ||
import com.pulumi.kubernetes.core_v1.*; | ||
|
||
public class Program { | ||
private static void stack(Context ctx) { | ||
// Create a GKE cluster | ||
var cluster = new Cluster("mygke", | ||
ClusterArgs.builder() | ||
.initialNodeCount(1) | ||
.minMasterVersion("1.20.7") | ||
.build() | ||
); | ||
|
||
// Build and export a Kubeconfig for the newly created cluster. | ||
var kubeconfig = Utils.buildKubeconfig(cluster); | ||
ctx.export("kubeconfig", kubeconfig); | ||
|
||
// Create a Kubernetes provider instance that uses our cluster from above. | ||
var clusterProvider = new Provider("gke-provider", | ||
ProviderArgs.builder().kubeconfig(kubeconfig).build()); | ||
|
||
// Create a Kubernetes Namespace | ||
var ns = new Namespace("test", | ||
NamespaceArgs.Empty, | ||
CustomResourceOptions.builder().provider(clusterProvider).build() | ||
); | ||
} | ||
|
||
public static void main(String[] args) { | ||
Pulumi.run(App::stack); | ||
} | ||
} | ||
``` | ||
|
||
Resources are defined declaratively using class constructors and argument builders. Dependencies between resources are managed automatically by the Pulumi engine based on the way you use variables in the program. You are free to use any libraries, helper functions—for instance, to build the kubeconfig string above, classes, if statements, for loops, and all the other tools available to Java developers. | ||
|
||
## Why is Java great for infrastructure too? | ||
|
||
Many of us love using Java to author our applications, so why not use it for infrastructure as code too? By using Java, you get many helpful features for your infrastructure code: | ||
|
||
- **Familiarity**: No need to learn DSLs or markup templating languages. | ||
|
||
- **Expressiveness**: Use loops, conditionals, pattern matching, async code, and more, to dynamically create infrastructure that meets the target environment's needs. | ||
|
||
- **Abstraction**: Encapsulate common patterns into classes and functions to hide complexity and avoid copy-and-pasting the same boilerplate repeatedly. | ||
|
||
- **Sharing and reuse**: Tap into a community of cloud applications and infrastructure experts by sharing and reusing Maven or Gradle packages with your team or the global community. | ||
|
||
- **Productivity**: Use your favorite IDE and get statement completion, go to definition, live error checking, refactoring, static analysis, and interactive documentation. | ||
|
||
- **Project organization**: Use common code structuring techniques to manage your infrastructure across one or more projects. | ||
|
||
- **Application lifecycle**: Use existing ALM systems and techniques to manage and deploy your infrastructure projects, including source control, code review, testing, and continuous integration (CI) and delivery (CD). | ||
|
||
Pulumi unlocks access to the entire JVM ecosystem—something that's easy to take for granted but is missing from other solutions based on DSLs or CLI scripts. This approach also helps developers and operators work better together using a shared foundation. Add all of the above together, and you get things done faster and more reliably. | ||
|
||
## Join the community and get started | ||
|
||
Today we've released the first preview of Pulumi for Java, including support for the entire breadth of services in AWS, Azure, Google Cloud, and more. To give Pulumi a try, visit the [Pulumi for Java docs](https://www.pulumi.com/docs/intro/languages/java/). | ||
|
||
There you will find several instructions on installing and getting started with Pulumi for Java. The following resources provide additional useful information: | ||
|
||
- [Full example code](https://github.com/pulumi/pulumi-java/blob/main/tests/examples/gcp-java-gke-hello-world/) | ||
|
||
- [Getting started with Pulumi](https://www.pulumi.com/docs/get-started/) | ||
|
||
- [General Pulumi overview (concepts and architecture)](https://www.pulumi.com/docs/intro/concepts/) | ||
|
||
- [Overview of premium Pulumi features for teams and Enterprises](https://www.pulumi.com/pricing/) | ||
|
||
Although Pulumi for Java is listed in "preview" status, it supports all of the most essential Pulumi programming model features (and the rest is on its way). Our goal is to gather feedback over the next few weeks, and we will be working hard to improve the Java experience across the board, including more examples and better documentation. | ||
|
||
Please [join the community in Slack](https://slack.pulumi.com/) to discuss your scenarios, ideas, and to get any needed assistance from the team and other end users. Pulumi is [open source on GitHub](https://github.com/pulumi/pulumi) and you can find the Java plugin at [pulumi/pulumi-java](https://github.com/pulumi/pulumi-java). | ||
|
||
There is an [Introduction to Infrastructure as Code in Java](https://www.pulumi.com/resources/introduction-to-infrastructure-as-code/) coming up on May 5th. | ||
|
||
We look forward to seeing the new and amazing cloud applications you build with Pulumi for Java! |
Binary file added
BIN
+455 KB
...lt/content/blog/announcing-infrastructure-as-code-with-java-and-pulumi/meta.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
218 changes: 218 additions & 0 deletions
218
themes/default/content/blog/announcing-pulumi-service-provider/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,218 @@ | ||
--- | ||
title: "Announcing the Pulumi Service Provider" | ||
|
||
h1: "Announcing the Pulumi Service Provider" | ||
|
||
# The date represents the post's publish date, and by default corresponds with | ||
# the date this file was generated. Posts with future dates are visible in development, | ||
# but excluded from production builds. Use the time and timezone-offset portions of | ||
# of this value to schedule posts for publishing later. | ||
date: 2022-05-04T06:55:00-07:00 | ||
|
||
# Draft posts are visible in development, but excluded from production builds. | ||
# Set this property to `false` before submitting your post for review. | ||
draft: false | ||
|
||
# Use the meta_desc property to provide a brief summary (one or two sentences) | ||
# of the content of the post, which is useful for targeting search results or social-media | ||
# previews. This field is required or the build will fail the linter test. | ||
meta_desc: Announcing the Pulumi Service Provider. Use Pulumi to configure the Pulumi Service. | ||
|
||
# The meta_image appears in social-media previews and on the blog home page. | ||
# A placeholder image representing the recommended format, dimensions and aspect | ||
# ratio has been provided for you. | ||
meta_image: meta.png | ||
|
||
# At least one author is required. The values in this list correspond with the `id` | ||
# properties of the team member files at /data/team/team. Create a file for yourself | ||
# if you don't already have one. | ||
authors: | ||
- myles-haynes | ||
|
||
# At least one tag is required. Lowercase, hyphen-delimited is recommended. | ||
tags: | ||
- features | ||
|
||
# See the blogging docs at https://github.com/pulumi/docs/blob/master/BLOGGING.md. | ||
# for additional details, and please remove these comments before submitting for review. | ||
--- | ||
|
||
One of the advantages of having a large and vocal community like we have, is the quantity and quality of product feedback we receive. This was highlighted by a GitHub issue submitted by a community member for a Pulumi Service Provider: | ||
|
||
> It’s a bit funny that a service that is all about configuration as code can’t be configured with code. | ||
The rest of the community agreed too, as this is one of our top customer product requests. Luckily Piers Karsenbarg, one of the Solutions Engineers at Pulumi, saw this and decided to build a Pulumi Provider for the Pulumi Service during a recent company hackathon. Once we saw the demo we knew we had to get in the hands of our customers! Over the last couple months, we've added a number of additional features, and polished some of the APIs for managing the Pulumi Service via Pulumi Infrastructure as Code. As a result, starting today, Pulumi’s users can manage *all* of their cloud infrastructure using Pulumi, including managing the state of the [Pulumi Service]({{< relref "/product/pulumi-service" >}}) itself! | ||
|
||
The Pulumi Service Provider builds on top of the [Pulumi Service REST API]({{< relref "/docs/reference/service-rest-api" >}}) which is another feature available to our customers to programmatically configuring the Pulumi Service. The Pulumi Service REST API is includes functionality to interact with and manipulate any kind of metadata managed by Pulumi. That includes Projects and Stacks, Previews and Updates, Organizations and Audit Logs. We have already seen Cloud Engineering teams using the Pulumi REST API to build all sorts of custom functionality. These new capabilities are especially powerful when used in combination with the [Automation API]({{< relref "/automation" >}}). | ||
|
||
The [Pulumi Service Provider](/registry/packages/pulumiservice) can be used in any Pulumi language, TypeScript, Python, Go, .NET, Java and YAML. It supports configuration of [Teams]({{< relref "/docs/intro/pulumi-service/teams" >}}), [Access Tokens]({{< relref "/docs/intro/pulumi-service/accounts" >}}), [Stack Tags]({{< relref "/docs/reference/cli/pulumi_stack_tag" >}}) and [Webhooks]({{< relref "/docs/intro/pulumi-service/webhooks" >}}) using infrastructure as code. | ||
|
||
## What resources are available? | ||
|
||
Based on feedback from customers, we've picked the following resources to support at launch: | ||
|
||
* [Webhooks]({{< relref "/docs/intro/pulumi-service/webhooks" >}}) | ||
* [Teams]({{< relref "/docs/intro/pulumi-service/teams" >}}) | ||
* [StackTags]({{< relref "/docs/reference/cli/pulumi_stack_tag" >}}) | ||
* [AccessTokens]({{< relref "/docs/intro/pulumi-service/accounts" >}}) | ||
|
||
## How do I get started? | ||
|
||
If you aren't already familiar with Pulumi, you'll want to head over to [Pulumi's getting started guide]({{< relref "/docs/get-started/" >}}) first. | ||
|
||
The Pulumi Service Provider requires an access token to authenticate with the Pulumi Service. You can set it in a few ways: | ||
|
||
1. Via the `PULUMI_ACCESS_TOKEN` environment variable. | ||
1. Via the `pulumiservice:accessToken` configuration value. | ||
1. Directly via the provider's constructor | ||
|
||
Once your access token is set up, you are ready to use the provider. | ||
|
||
{{% notes type="info" %}} | ||
The provider will only have access to resources that your token has access to. | ||
{{% /notes %}} | ||
|
||
**Here's a sample of what you can do:** | ||
{{< chooser language "yaml,typescript,go,python,csharp" >}} | ||
{{% choosable language yaml %}} | ||
|
||
```yaml | ||
name: pulumi-service-teams-example-yaml | ||
runtime: yaml | ||
description: An example of using yaml to create a team | ||
resources: | ||
team: | ||
type: pulumiservice:index:Team | ||
properties: | ||
name: pulumi-up-team | ||
description: This was created with Pulumi | ||
displayName: PulumiUP Team | ||
organizationName: pulumi-up | ||
teamType: pulumi | ||
members: | ||
- piers | ||
- myles | ||
- meagan | ||
outputs: | ||
members: ${team.members} | ||
``` | ||
{{% /choosable %}} | ||
{{% choosable language typescript %}} | ||
```typescript | ||
import * as pulumi from "@pulumi/pulumi"; | ||
import * as service from "@pulumi/pulumiservice"; | ||
|
||
const team = new service.Team("team", { | ||
name: "pulumi-up-team", | ||
displayName: "PulumiUP Team", | ||
description: "This was created with Pulumi", | ||
organizationName: "pulumi-up", | ||
teamType: "pulumi", | ||
members: [ | ||
"piers", | ||
"myles", | ||
"meagan" | ||
], | ||
}); | ||
|
||
export const members = team.members; | ||
``` | ||
|
||
{{% /choosable %}} | ||
{{% choosable language go %}} | ||
|
||
```go | ||
package main | ||
|
||
import ( | ||
"github.com/pulumi/pulumi-pulumiservice/sdk/go/pulumiservice" | ||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi" | ||
) | ||
|
||
func main() { | ||
pulumi.Run(func(ctx *pulumi.Context) error { | ||
team, err := pulumiservice.NewTeam(ctx, "team", &pulumiservice.TeamArgs{ | ||
Name: pulumi.String("pulumi-up-team"), | ||
Description: pulumi.String("This was created with Pulumi"), | ||
DisplayName: pulumi.String("PulumiUP Team"), | ||
OrganizationName: pulumi.String("pulumi-up"), | ||
TeamType: pulumi.String("pulumi"), | ||
Members: pulumi.ToStringArray([]string{"piers", "myles", "meagan"}), | ||
}) | ||
if err != nil { | ||
return err | ||
} | ||
ctx.Export("members", team.Members) | ||
return nil | ||
}) | ||
} | ||
``` | ||
|
||
{{% /choosable %}} | ||
{{% choosable language python %}} | ||
|
||
```python | ||
import pulumi | ||
from pulumi_pulumiservice import Team | ||
|
||
team = Team("team", | ||
name="pulumi-up-team", | ||
description="This was created with Pulumi", | ||
display_name="PulumiUP Team", | ||
organization_name="pulumi-up", | ||
team_type="pulumi", | ||
members=["piers", "myles", "meagan"]) | ||
|
||
pulumi.export("members", team.members) | ||
``` | ||
|
||
{{% /choosable %}} | ||
|
||
{{% choosable language csharp %}} | ||
|
||
```csharp | ||
using Pulumi; | ||
using Pulumi.PulumiService; | ||
class ExampleTeam: Stack { | ||
public ExampleTeam() | ||
{ | ||
var team = new Team("team", new TeamArgs | ||
{ | ||
Name = "pulumi-up-team", | ||
Description = "This was created with Pulumi", | ||
DisplayName = "PulumiUP Team", | ||
OrganizationName = "pulumi-up", | ||
TeamType = "pulumi", | ||
Members = {"piers", "myles", "meagan"} | ||
}); | ||
|
||
this.Members = team.Members; | ||
} | ||
|
||
[Output] public Output<string> Members { get; set; } | ||
} | ||
``` | ||
|
||
{{% /choosable %}} | ||
|
||
{{% /chooser %}} | ||
|
||
Once you've created your team, you can navigate to the Pulumi Service in your browser and view your team: | ||
|
||
 | ||
|
||
## Can Self Hosted customers use the Pulumi Service Provider? | ||
|
||
Yes! You will be able to use the Pulumi Service Provider. You can configure the URL via the following methods: | ||
|
||
1. Via the `PULUMI_BACKEND_URL` environment variable. You'll want to set it to the API URL of the service. | ||
2. Via the `pulumiservice:apiUrl` configuration value. | ||
|
||
The default URL for the provider is: <https://api.pulumi.com>. | ||
|
||
## What's next? | ||
|
||
We’re excited to be able to offer Pulumi Infrastructure as Code users the ability to manage the Pulumi Service with IaC. Over the coming months, we have plans to add more resources, and to build on the Pulumi Service Provider functionality as we see what our customers use it for. As always, please feel free to submit feature requests and bug reports to [Pulumi Service Provider GitHub Repo](https://github.com/pulumi/pulumi-pulumiservice). | ||
We look forward to seeing what you build with the Pulumi Service Provider! |
Binary file added
BIN
+248 KB
themes/default/content/blog/announcing-pulumi-service-provider/meta.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+237 KB
themes/default/content/blog/announcing-pulumi-service-provider/team.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.