Skip to content

Commit

Permalink
Use Plugin Framework bridge to bring in new resources (#2557)
Browse files Browse the repository at this point in the history
Start serving some resources off Plugin Framework
Add acceptance test for PF based resources
Use PlanState for diff strategy with provider
Bring in newer pu/pu so the test harness framework support Pulumi yaml.
Skip EditDirs in TestAccWebserver to workaround pulumi/pulumi#12859

---------

Co-authored-by: Ramon Quitales <[email protected]>
  • Loading branch information
t0yv0 and rquitales authored Jun 23, 2023
1 parent ae83fcf commit 3750271
Show file tree
Hide file tree
Showing 474 changed files with 229,544 additions and 11,541 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/run-acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,9 @@ jobs:
android: true
haskell: true
swap-storage: true
large-packages: true
# TODO: enable once transient error with azure is resolved
# E: Failed to fetch http://azure.archive.ubuntu.com/ubuntu/pool/universe/d/dotnet7/aspnetcore-targeting-pack-7.0_7.0.105-0ubuntu1%7e22.04.1_amd64.deb 404 Not Found [IP: 40.81.13.82 80]
large-packages: false
- name: Build tfgen & provider binaries
run: make provider
- if: github.event_name == 'pull_request'
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![NPM version](https://badge.fury.io/js/%40pulumi%2Faws.svg)](https://www.npmjs.com/package/@pulumi/aws)
[![Python version](https://badge.fury.io/py/pulumi-aws.svg)](https://pypi.org/project/pulumi-aws)
[![NuGet version](https://badge.fury.io/nu/pulumi.aws.svg)](https://badge.fury.io/nu/pulumi.aws)
[![PkgGoDev](https://pkg.go.dev/badge/github.com/pulumi/pulumi-aws/sdk/v5/go)](https://pkg.go.dev/github.com/pulumi/pulumi-aws/sdk/v5/go)
[![PkgGoDev](https://pkg.go.dev/badge/github.com/pulumi/pulumi-aws/sdk/v6/go)](https://pkg.go.dev/github.com/pulumi/pulumi-aws/sdk/v6/go)
[![License](https://img.shields.io/github/license/pulumi/pulumi-aws)](https://github.com/pulumi/pulumi-aws/blob/master/LICENSE)

# Amazon Web Services (AWS) provider
Expand Down Expand Up @@ -41,7 +41,7 @@ To use from Python, install using `pip`:

To use from Go, use `go get` to grab the latest version of the library

$ go get github.com/pulumi/pulumi-aws/sdk/v5
$ go get github.com/pulumi/pulumi-aws/sdk/v6

### .NET

Expand Down Expand Up @@ -71,7 +71,7 @@ The following configuration points are available:

- `aws:region` - (Required) This is the AWS region.

- `aws:accessKey` - (Optional) This is the AWS access key. It can also be sourced from the
- `aws:accessKey` - (Optional) This is the AWS access key. It can also be sourced from the
`AWS_ACCESS_KEY_ID` environment variable, or via a shared credentials file if `aws:profile` is specified.
- `aws:secretKey` - (Optional) This is the AWS secret key. It can also be sourced from the
`AWS_SECRET_ACCESS_KEY` environment variable, or via a shared credentials file if `aws:profile` is specified.
Expand All @@ -80,7 +80,7 @@ The following configuration points are available:
`aws:profile` is specified, `~/.aws/credentials` will be used.
- `aws:token` - (Optional) Session token for validating temporary credentials. Typically provided after successful
identity federation or Multi-Factor Authentication (MFA) login. With MFA login, this is the session token provided
afterward, not the 6 digit MFA code used to get temporary credentials. It can also be sourced from the
afterward, not the 6 digit MFA code used to get temporary credentials. It can also be sourced from the
`AWS_SESSION_TOKEN` environment variable.
- `aws:maxRetries` - (Optional) This is the maximum number of times an API call is retried, in the case where requests
are being throttled or experiencing transient failures. The delay between the subsequent API calls increases
Expand Down
24 changes: 14 additions & 10 deletions examples/examples_nodejs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,16 +358,20 @@ func TestAccWebserver(t *testing.T) {
test := getJSBaseOptions(t).
With(integration.ProgramTestOptions{
Dir: filepath.Join(getCwd(t), "webserver"),
EditDirs: []integration.EditDir{
// First, look up the server just created using get. No new resources.
createEditDir(filepath.Join(getCwd(t), "webserver", "variants", "get")),
// Next, patch the ingress rules by adding port 20: should be a quick update.
createEditDir(filepath.Join(getCwd(t), "webserver", "variants", "ssh")),
// Now do the reverse; this basically ensures that an update that deletes a property works.
createEditDir(filepath.Join(getCwd(t), "webserver")),
// Next patch the security group description, necessitating a full replacement of resources.
createEditDir(filepath.Join(getCwd(t), "webserver", "variants", "ssh_description")),
}})
//
// TODO[pulumi/pulumi#12859] temporarily disable EditDirs to workaround ProgramTest bug
//
// EditDirs: []integration.EditDir{
// // First, look up the server just created using get. No new resources.
// createEditDir(filepath.Join(getCwd(t), "webserver", "variants", "get")),
// // Next, patch the ingress rules by adding port 20: should be a quick update.
// createEditDir(filepath.Join(getCwd(t), "webserver", "variants", "ssh")),
// // Now do the reverse; this basically ensures that an update that deletes a property works.
// createEditDir(filepath.Join(getCwd(t), "webserver")),
// // Next patch the security group description, necessitating a full replacement of resources.
// createEditDir(filepath.Join(getCwd(t), "webserver", "variants", "ssh_description")),
// },
})

integration.ProgramTest(t, &test)
}
Expand Down
55 changes: 55 additions & 0 deletions examples/examples_yaml_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// Copyright 2016-2023, Pulumi Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build nodejs || all
// +build nodejs all

package examples

// NOTE about build tags: CI does not understand yaml-specific tags yet, but splits builds per language to run on
// separate runners. This file piggy-backs on the nodejs tag so yaml tests will run on the same runner as node tests.

import (
"os"
"path/filepath"
"testing"

"github.com/pulumi/pulumi/pkg/v3/testing/integration"
)

// This test is not a proper examlpe but a test of the new capability to deploy Plugin Framework and SDKv2 based
// resources alongside each other in the same provider.
func TestAccPluginFramework(t *testing.T) {
test := getYamlBaseOptions(t).
With(integration.ProgramTestOptions{
Dir: filepath.Join(getCwd(t), "plugin-framework"),
})

integration.ProgramTest(t, &test)
}

func getYamlBaseOptions(t *testing.T) integration.ProgramTestOptions {
config := map[string]string{}
_, usingProfiles := os.LookupEnv("AWS_PROFILE")
if !usingProfiles {
envRegion := getEnvRegion(t)
config = map[string]string{
"aws:region": envRegion,
}
}
// Do not use baseOptions here for now as those disable refresh checking. Be extra conservative.
return integration.ProgramTestOptions{
Config: config,
}
}
Loading

0 comments on commit 3750271

Please sign in to comment.