diff --git a/.changes/unreleased/Improvements-482.yaml b/.changes/unreleased/Improvements-482.yaml new file mode 100644 index 00000000..01483562 --- /dev/null +++ b/.changes/unreleased/Improvements-482.yaml @@ -0,0 +1,6 @@ +component: sdk +kind: Improvements +body: updated pulumi submodule and go.mod sdk/pkg and excluded failing conformance tests +time: 2025-02-20T13:37:32.609837+09:00 +custom: + PR: "482" diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index b9514195..04543e05 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -29,6 +29,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + submodules: 'recursive' - name: Setup dotnet SDK uses: actions/setup-dotnet@v4 - name: Setup dotnet SDK diff --git a/pulumi b/pulumi index 878c5fe4..8c3c24e3 160000 --- a/pulumi +++ b/pulumi @@ -1 +1 @@ -Subproject commit 878c5fe445df677a7dc968024febc268941282f3 +Subproject commit 8c3c24e3bd891ba7a2c0d34d2b29fe4a26f51713 diff --git a/pulumi-language-dotnet/language_test.go b/pulumi-language-dotnet/language_test.go index a56347cf..5783523b 100644 --- a/pulumi-language-dotnet/language_test.go +++ b/pulumi-language-dotnet/language_test.go @@ -211,6 +211,10 @@ func TestLanguage(t *testing.T) { require.NoError(t, err) expectedToFail := map[string]string{ + "l1-builtin-can": "#489 codegen not implemented", + "l1-builtin-try": "#490 codegen not implemented", + "l1-keyword-overlap": "#493 update to pulumi 1.50 conformance failure", + "l2-component-call-simple": "#491 update to pulumi 1.50 conformance failure", "l2-resource-asset-archive": "The namespace 'Pulumi.AssetArchive' conflicts with the type 'AssetArchive' in 'Pulumi, Version=1.0.0.0", "l2-resource-config": "sdk packing for config: build error before pack", "l2-resource-alpha": "wrong package reference Include=Pulumi.Alpha.3.0 Version=0-alpha.1.internal", diff --git a/pulumi-language-dotnet/testdata/projects/l1-keyword-overlap/.gitignore b/pulumi-language-dotnet/testdata/projects/l1-keyword-overlap/.gitignore new file mode 100644 index 00000000..e6452706 --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l1-keyword-overlap/.gitignore @@ -0,0 +1,353 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ diff --git a/pulumi-language-dotnet/testdata/projects/l1-keyword-overlap/Program.cs b/pulumi-language-dotnet/testdata/projects/l1-keyword-overlap/Program.cs new file mode 100644 index 00000000..1b00769b --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l1-keyword-overlap/Program.cs @@ -0,0 +1,39 @@ +using System.Collections.Generic; +using System.Linq; +using Pulumi; + +return await Deployment.RunAsync(() => +{ + // Keywords in various languages should be renamed and work. + var @class = "class_output_string"; + + var export = "export_output_string"; + + var import = "import_output_string"; + + var mod = "mod_output_string"; + + var @object = + { + { "object", "object_output_string" }, + }; + + var self = "self_output_string"; + + var @this = "this_output_string"; + + var @if = "if_output_string"; + + return new Dictionary + { + ["class"] = @class, + ["export"] = export, + ["import"] = import, + ["mod"] = mod, + ["object"] = @object, + ["self"] = self, + ["this"] = @this, + ["if"] = @if, + }; +}); + diff --git a/pulumi-language-dotnet/testdata/projects/l1-keyword-overlap/Pulumi.yaml b/pulumi-language-dotnet/testdata/projects/l1-keyword-overlap/Pulumi.yaml new file mode 100644 index 00000000..6d4c6bed --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l1-keyword-overlap/Pulumi.yaml @@ -0,0 +1,2 @@ +name: l1-keyword-overlap +runtime: dotnet diff --git a/pulumi-language-dotnet/testdata/projects/l1-keyword-overlap/l1-keyword-overlap.csproj b/pulumi-language-dotnet/testdata/projects/l1-keyword-overlap/l1-keyword-overlap.csproj new file mode 100644 index 00000000..f4c1b567 --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l1-keyword-overlap/l1-keyword-overlap.csproj @@ -0,0 +1,15 @@ + + + + Exe + net6.0 + enable + + + ROOT/artifacts/Pulumi;$(RestoreSources) + + + + + + \ No newline at end of file diff --git a/pulumi-language-dotnet/testdata/projects/l2-component-component-resource-ref/.gitignore b/pulumi-language-dotnet/testdata/projects/l2-component-component-resource-ref/.gitignore new file mode 100644 index 00000000..e6452706 --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l2-component-component-resource-ref/.gitignore @@ -0,0 +1,353 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ diff --git a/pulumi-language-dotnet/testdata/projects/l2-component-component-resource-ref/Program.cs b/pulumi-language-dotnet/testdata/projects/l2-component-component-resource-ref/Program.cs new file mode 100644 index 00000000..5e246cbd --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l2-component-component-resource-ref/Program.cs @@ -0,0 +1,29 @@ +using System.Collections.Generic; +using System.Linq; +using Pulumi; +using Component = Pulumi.Component; + +return await Deployment.RunAsync(() => +{ + var component1 = new Component.ComponentCustomRefOutput("component1", new() + { + Value = "foo-bar-baz", + }); + + var component2 = new Component.ComponentCustomRefInputOutput("component2", new() + { + InputRef = component1.Ref, + }); + + var custom1 = new Component.Custom("custom1", new() + { + Value = component2.InputRef.Apply(inputRef => inputRef.Value), + }); + + var custom2 = new Component.Custom("custom2", new() + { + Value = component2.OutputRef.Apply(outputRef => outputRef.Value), + }); + +}); + diff --git a/pulumi-language-dotnet/testdata/projects/l2-component-component-resource-ref/Pulumi.yaml b/pulumi-language-dotnet/testdata/projects/l2-component-component-resource-ref/Pulumi.yaml new file mode 100644 index 00000000..d191aa4a --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l2-component-component-resource-ref/Pulumi.yaml @@ -0,0 +1,2 @@ +name: l2-component-component-resource-ref +runtime: dotnet diff --git a/pulumi-language-dotnet/testdata/projects/l2-component-component-resource-ref/l2-component-component-resource-ref.csproj b/pulumi-language-dotnet/testdata/projects/l2-component-component-resource-ref/l2-component-component-resource-ref.csproj new file mode 100644 index 00000000..bc01e73b --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l2-component-component-resource-ref/l2-component-component-resource-ref.csproj @@ -0,0 +1,16 @@ + + + + Exe + net6.0 + enable + + + ROOT/artifacts/Pulumi;ROOT/artifacts/Pulumi.Component;$(RestoreSources) + + + + + + + \ No newline at end of file diff --git a/pulumi-language-dotnet/testdata/projects/l2-component-program-resource-ref/.gitignore b/pulumi-language-dotnet/testdata/projects/l2-component-program-resource-ref/.gitignore new file mode 100644 index 00000000..e6452706 --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l2-component-program-resource-ref/.gitignore @@ -0,0 +1,353 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ diff --git a/pulumi-language-dotnet/testdata/projects/l2-component-program-resource-ref/Program.cs b/pulumi-language-dotnet/testdata/projects/l2-component-program-resource-ref/Program.cs new file mode 100644 index 00000000..54e961dc --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l2-component-program-resource-ref/Program.cs @@ -0,0 +1,24 @@ +using System.Collections.Generic; +using System.Linq; +using Pulumi; +using Component = Pulumi.Component; + +return await Deployment.RunAsync(() => +{ + var component1 = new Component.ComponentCustomRefOutput("component1", new() + { + Value = "foo-bar-baz", + }); + + var custom1 = new Component.Custom("custom1", new() + { + Value = component1.Value, + }); + + var custom2 = new Component.Custom("custom2", new() + { + Value = component1.Ref.Apply(@ref => @ref.Value), + }); + +}); + diff --git a/pulumi-language-dotnet/testdata/projects/l2-component-program-resource-ref/Pulumi.yaml b/pulumi-language-dotnet/testdata/projects/l2-component-program-resource-ref/Pulumi.yaml new file mode 100644 index 00000000..e98bf427 --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l2-component-program-resource-ref/Pulumi.yaml @@ -0,0 +1,2 @@ +name: l2-component-program-resource-ref +runtime: dotnet diff --git a/pulumi-language-dotnet/testdata/projects/l2-component-program-resource-ref/l2-component-program-resource-ref.csproj b/pulumi-language-dotnet/testdata/projects/l2-component-program-resource-ref/l2-component-program-resource-ref.csproj new file mode 100644 index 00000000..bc01e73b --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l2-component-program-resource-ref/l2-component-program-resource-ref.csproj @@ -0,0 +1,16 @@ + + + + Exe + net6.0 + enable + + + ROOT/artifacts/Pulumi;ROOT/artifacts/Pulumi.Component;$(RestoreSources) + + + + + + + \ No newline at end of file diff --git a/pulumi-language-dotnet/testdata/projects/l2-resource-invoke-dynamic-function/.gitignore b/pulumi-language-dotnet/testdata/projects/l2-resource-invoke-dynamic-function/.gitignore new file mode 100644 index 00000000..e6452706 --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l2-resource-invoke-dynamic-function/.gitignore @@ -0,0 +1,353 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ diff --git a/pulumi-language-dotnet/testdata/projects/l2-resource-invoke-dynamic-function/Program.cs b/pulumi-language-dotnet/testdata/projects/l2-resource-invoke-dynamic-function/Program.cs new file mode 100644 index 00000000..9b9bb844 --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l2-resource-invoke-dynamic-function/Program.cs @@ -0,0 +1,23 @@ +using System.Collections.Generic; +using System.Linq; +using Pulumi; +using AnyTypeFunction = Pulumi.AnyTypeFunction; + +return await Deployment.RunAsync(() => +{ + var localValue = "hello"; + + return new Dictionary + { + ["dynamic"] = AnyTypeFunction.DynListToDyn.Invoke(new() + { + Inputs = new[] + { + "hello", + localValue, + null, + }, + }).Apply(invoke => invoke.Result), + }; +}); + diff --git a/pulumi-language-dotnet/testdata/projects/l2-resource-invoke-dynamic-function/Pulumi.yaml b/pulumi-language-dotnet/testdata/projects/l2-resource-invoke-dynamic-function/Pulumi.yaml new file mode 100644 index 00000000..21e22a35 --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l2-resource-invoke-dynamic-function/Pulumi.yaml @@ -0,0 +1,2 @@ +name: l2-resource-invoke-dynamic-function +runtime: dotnet diff --git a/pulumi-language-dotnet/testdata/projects/l2-resource-invoke-dynamic-function/l2-resource-invoke-dynamic-function.csproj b/pulumi-language-dotnet/testdata/projects/l2-resource-invoke-dynamic-function/l2-resource-invoke-dynamic-function.csproj new file mode 100644 index 00000000..dff96bb9 --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l2-resource-invoke-dynamic-function/l2-resource-invoke-dynamic-function.csproj @@ -0,0 +1,16 @@ + + + + Exe + net6.0 + enable + + + ROOT/artifacts/Pulumi;ROOT/artifacts/Pulumi.AnyTypeFunction;$(RestoreSources) + + + + + + + \ No newline at end of file diff --git a/pulumi-language-dotnet/testdata/projects/l2-resource-keyword-overlap/.gitignore b/pulumi-language-dotnet/testdata/projects/l2-resource-keyword-overlap/.gitignore new file mode 100644 index 00000000..e6452706 --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l2-resource-keyword-overlap/.gitignore @@ -0,0 +1,353 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ diff --git a/pulumi-language-dotnet/testdata/projects/l2-resource-keyword-overlap/Program.cs b/pulumi-language-dotnet/testdata/projects/l2-resource-keyword-overlap/Program.cs new file mode 100644 index 00000000..e728358b --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l2-resource-keyword-overlap/Program.cs @@ -0,0 +1,63 @@ +using System.Collections.Generic; +using System.Linq; +using Pulumi; +using Simple = Pulumi.Simple; + +return await Deployment.RunAsync(() => +{ + var @class = new Simple.Resource("class", new() + { + Value = true, + }); + + var export = new Simple.Resource("export", new() + { + Value = true, + }); + + var mod = new Simple.Resource("mod", new() + { + Value = true, + }); + + var import = new Simple.Resource("import", new() + { + Value = true, + }); + + // TODO(pulumi/pulumi#18246): Pcl should support scoping based on resource type just like HCL does in TF so we can uncomment this. + // output "import" { + // value = Resource["import"] + // } + var @object = new Simple.Resource("object", new() + { + Value = true, + }); + + var self = new Simple.Resource("self", new() + { + Value = true, + }); + + var @this = new Simple.Resource("this", new() + { + Value = true, + }); + + var @if = new Simple.Resource("if", new() + { + Value = true, + }); + + return new Dictionary + { + ["class"] = @class, + ["export"] = export, + ["mod"] = mod, + ["object"] = @object, + ["self"] = self, + ["this"] = @this, + ["if"] = @if, + }; +}); + diff --git a/pulumi-language-dotnet/testdata/projects/l2-resource-keyword-overlap/Pulumi.yaml b/pulumi-language-dotnet/testdata/projects/l2-resource-keyword-overlap/Pulumi.yaml new file mode 100644 index 00000000..c15463d2 --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l2-resource-keyword-overlap/Pulumi.yaml @@ -0,0 +1,2 @@ +name: l2-resource-keyword-overlap +runtime: dotnet diff --git a/pulumi-language-dotnet/testdata/projects/l2-resource-keyword-overlap/l2-resource-keyword-overlap.csproj b/pulumi-language-dotnet/testdata/projects/l2-resource-keyword-overlap/l2-resource-keyword-overlap.csproj new file mode 100644 index 00000000..a523a762 --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l2-resource-keyword-overlap/l2-resource-keyword-overlap.csproj @@ -0,0 +1,16 @@ + + + + Exe + net6.0 + enable + + + ROOT/artifacts/Pulumi;ROOT/artifacts/Pulumi.Simple;$(RestoreSources) + + + + + + + \ No newline at end of file diff --git a/pulumi-language-dotnet/testdata/projects/l2-resource-option-deleted-with/.gitignore b/pulumi-language-dotnet/testdata/projects/l2-resource-option-deleted-with/.gitignore new file mode 100644 index 00000000..e6452706 --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l2-resource-option-deleted-with/.gitignore @@ -0,0 +1,353 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ diff --git a/pulumi-language-dotnet/testdata/projects/l2-resource-option-deleted-with/Program.cs b/pulumi-language-dotnet/testdata/projects/l2-resource-option-deleted-with/Program.cs new file mode 100644 index 00000000..b308c818 --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l2-resource-option-deleted-with/Program.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using System.Linq; +using Pulumi; +using Simple = Pulumi.Simple; + +return await Deployment.RunAsync(() => +{ + var target = new Simple.Resource("target", new() + { + Value = true, + }); + + var deletedWith = new Simple.Resource("deletedWith", new() + { + Value = true, + }, new CustomResourceOptions + { + DeletedWith = target, + }); + + var notDeletedWith = new Simple.Resource("notDeletedWith", new() + { + Value = true, + }); + +}); + diff --git a/pulumi-language-dotnet/testdata/projects/l2-resource-option-deleted-with/Pulumi.yaml b/pulumi-language-dotnet/testdata/projects/l2-resource-option-deleted-with/Pulumi.yaml new file mode 100644 index 00000000..a492f815 --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l2-resource-option-deleted-with/Pulumi.yaml @@ -0,0 +1,2 @@ +name: l2-resource-option-deleted-with +runtime: dotnet diff --git a/pulumi-language-dotnet/testdata/projects/l2-resource-option-deleted-with/l2-resource-option-deleted-with.csproj b/pulumi-language-dotnet/testdata/projects/l2-resource-option-deleted-with/l2-resource-option-deleted-with.csproj new file mode 100644 index 00000000..a523a762 --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l2-resource-option-deleted-with/l2-resource-option-deleted-with.csproj @@ -0,0 +1,16 @@ + + + + Exe + net6.0 + enable + + + ROOT/artifacts/Pulumi;ROOT/artifacts/Pulumi.Simple;$(RestoreSources) + + + + + + + \ No newline at end of file diff --git a/pulumi-language-dotnet/testdata/projects/l2-resource-option-protect/.gitignore b/pulumi-language-dotnet/testdata/projects/l2-resource-option-protect/.gitignore new file mode 100644 index 00000000..e6452706 --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l2-resource-option-protect/.gitignore @@ -0,0 +1,353 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ diff --git a/pulumi-language-dotnet/testdata/projects/l2-resource-option-protect/Program.cs b/pulumi-language-dotnet/testdata/projects/l2-resource-option-protect/Program.cs new file mode 100644 index 00000000..59b64a8a --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l2-resource-option-protect/Program.cs @@ -0,0 +1,30 @@ +using System.Collections.Generic; +using System.Linq; +using Pulumi; +using Simple = Pulumi.Simple; + +return await Deployment.RunAsync(() => +{ + var @protected = new Simple.Resource("protected", new() + { + Value = true, + }, new CustomResourceOptions + { + Protect = true, + }); + + var unprotected = new Simple.Resource("unprotected", new() + { + Value = true, + }, new CustomResourceOptions + { + Protect = false, + }); + + var defaulted = new Simple.Resource("defaulted", new() + { + Value = true, + }); + +}); + diff --git a/pulumi-language-dotnet/testdata/projects/l2-resource-option-protect/Pulumi.yaml b/pulumi-language-dotnet/testdata/projects/l2-resource-option-protect/Pulumi.yaml new file mode 100644 index 00000000..a16b2501 --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l2-resource-option-protect/Pulumi.yaml @@ -0,0 +1,2 @@ +name: l2-resource-option-protect +runtime: dotnet diff --git a/pulumi-language-dotnet/testdata/projects/l2-resource-option-protect/l2-resource-option-protect.csproj b/pulumi-language-dotnet/testdata/projects/l2-resource-option-protect/l2-resource-option-protect.csproj new file mode 100644 index 00000000..a523a762 --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l2-resource-option-protect/l2-resource-option-protect.csproj @@ -0,0 +1,16 @@ + + + + Exe + net6.0 + enable + + + ROOT/artifacts/Pulumi;ROOT/artifacts/Pulumi.Simple;$(RestoreSources) + + + + + + + \ No newline at end of file diff --git a/pulumi-language-dotnet/testdata/projects/l2-resource-option-retain-on-delete/.gitignore b/pulumi-language-dotnet/testdata/projects/l2-resource-option-retain-on-delete/.gitignore new file mode 100644 index 00000000..e6452706 --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l2-resource-option-retain-on-delete/.gitignore @@ -0,0 +1,353 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ diff --git a/pulumi-language-dotnet/testdata/projects/l2-resource-option-retain-on-delete/Program.cs b/pulumi-language-dotnet/testdata/projects/l2-resource-option-retain-on-delete/Program.cs new file mode 100644 index 00000000..565b9f29 --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l2-resource-option-retain-on-delete/Program.cs @@ -0,0 +1,30 @@ +using System.Collections.Generic; +using System.Linq; +using Pulumi; +using Simple = Pulumi.Simple; + +return await Deployment.RunAsync(() => +{ + var retainOnDelete = new Simple.Resource("retainOnDelete", new() + { + Value = true, + }, new CustomResourceOptions + { + RetainOnDelete = true, + }); + + var notRetainOnDelete = new Simple.Resource("notRetainOnDelete", new() + { + Value = true, + }, new CustomResourceOptions + { + RetainOnDelete = false, + }); + + var defaulted = new Simple.Resource("defaulted", new() + { + Value = true, + }); + +}); + diff --git a/pulumi-language-dotnet/testdata/projects/l2-resource-option-retain-on-delete/Pulumi.yaml b/pulumi-language-dotnet/testdata/projects/l2-resource-option-retain-on-delete/Pulumi.yaml new file mode 100644 index 00000000..8dfedc28 --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l2-resource-option-retain-on-delete/Pulumi.yaml @@ -0,0 +1,2 @@ +name: l2-resource-option-retain-on-delete +runtime: dotnet diff --git a/pulumi-language-dotnet/testdata/projects/l2-resource-option-retain-on-delete/l2-resource-option-retain-on-delete.csproj b/pulumi-language-dotnet/testdata/projects/l2-resource-option-retain-on-delete/l2-resource-option-retain-on-delete.csproj new file mode 100644 index 00000000..a523a762 --- /dev/null +++ b/pulumi-language-dotnet/testdata/projects/l2-resource-option-retain-on-delete/l2-resource-option-retain-on-delete.csproj @@ -0,0 +1,16 @@ + + + + Exe + net6.0 + enable + + + ROOT/artifacts/Pulumi;ROOT/artifacts/Pulumi.Simple;$(RestoreSources) + + + + + + + \ No newline at end of file diff --git a/pulumi-language-dotnet/testdata/sdks/any-type-function-15.0.0/DynListToDyn.cs b/pulumi-language-dotnet/testdata/sdks/any-type-function-15.0.0/DynListToDyn.cs new file mode 100644 index 00000000..b8ea2a37 --- /dev/null +++ b/pulumi-language-dotnet/testdata/sdks/any-type-function-15.0.0/DynListToDyn.cs @@ -0,0 +1,69 @@ +// *** WARNING: this file was generated by pulumi-language-dotnet. *** +// *** 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.AnyTypeFunction +{ + public static class DynListToDyn + { + public static Task InvokeAsync(DynListToDynArgs? args = null, InvokeOptions? options = null) + => global::Pulumi.Deployment.Instance.InvokeAsync("any-type-function:index:dynListToDyn", args ?? new DynListToDynArgs(), options.WithDefaults()); + + public static Output Invoke(DynListToDynInvokeArgs? args = null, InvokeOptions? options = null) + => global::Pulumi.Deployment.Instance.Invoke("any-type-function:index:dynListToDyn", args ?? new DynListToDynInvokeArgs(), options.WithDefaults()); + + public static Output Invoke(DynListToDynInvokeArgs args, InvokeOutputOptions options) + => global::Pulumi.Deployment.Instance.Invoke("any-type-function:index:dynListToDyn", args ?? new DynListToDynInvokeArgs(), options.WithDefaults()); + } + + + public sealed class DynListToDynArgs : global::Pulumi.InvokeArgs + { + [Input("inputs")] + private List? _inputs; + public List Inputs + { + get => _inputs ?? (_inputs = new List()); + set => _inputs = value; + } + + public DynListToDynArgs() + { + } + public static new DynListToDynArgs Empty => new DynListToDynArgs(); + } + + public sealed class DynListToDynInvokeArgs : global::Pulumi.InvokeArgs + { + [Input("inputs")] + private InputList? _inputs; + public InputList Inputs + { + get => _inputs ?? (_inputs = new InputList()); + set => _inputs = value; + } + + public DynListToDynInvokeArgs() + { + } + public static new DynListToDynInvokeArgs Empty => new DynListToDynInvokeArgs(); + } + + + [OutputType] + public sealed class DynListToDynResult + { + public readonly object Result; + + [OutputConstructor] + private DynListToDynResult(object result) + { + Result = result; + } + } +} diff --git a/pulumi-language-dotnet/testdata/sdks/any-type-function-15.0.0/Provider.cs b/pulumi-language-dotnet/testdata/sdks/any-type-function-15.0.0/Provider.cs new file mode 100644 index 00000000..bd9aaf32 --- /dev/null +++ b/pulumi-language-dotnet/testdata/sdks/any-type-function-15.0.0/Provider.cs @@ -0,0 +1,47 @@ +// *** WARNING: this file was generated by pulumi-language-dotnet. *** +// *** 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.AnyTypeFunction +{ + [AnyTypeFunctionResourceType("pulumi:providers:any-type-function")] + public partial class Provider : global::Pulumi.ProviderResource + { + /// + /// Create a Provider resource with the given unique name, arguments, and options. + /// + /// + /// The unique name of the resource + /// The arguments used to populate this resource's properties + /// A bag of options that control this resource's behavior + public Provider(string name, ProviderArgs? args = null, CustomResourceOptions? options = null) + : base("any-type-function", name, args ?? new ProviderArgs(), MakeResourceOptions(options, "")) + { + } + + private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input? id) + { + var defaultOptions = new CustomResourceOptions + { + Version = Utilities.Version, + }; + 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; + } + } + + public sealed class ProviderArgs : global::Pulumi.ResourceArgs + { + public ProviderArgs() + { + } + public static new ProviderArgs Empty => new ProviderArgs(); + } +} diff --git a/pulumi-language-dotnet/testdata/sdks/any-type-function-15.0.0/Pulumi.AnyTypeFunction.csproj b/pulumi-language-dotnet/testdata/sdks/any-type-function-15.0.0/Pulumi.AnyTypeFunction.csproj new file mode 100644 index 00000000..b4c12330 --- /dev/null +++ b/pulumi-language-dotnet/testdata/sdks/any-type-function-15.0.0/Pulumi.AnyTypeFunction.csproj @@ -0,0 +1,65 @@ + + + + true + Pulumi Corp. + Pulumi Corp. + + + + + logo.png + 15.0.0 + + net6.0 + enable + + + + true + 1701;1702;1591 + + + + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb + true + true + + + + true + + + + ROOT/artifacts/Pulumi;$(RestoreSources) + + + + + + + + + + + + + + + + + + + + + + + + + + True + + + + + diff --git a/pulumi-language-dotnet/testdata/sdks/any-type-function-15.0.0/README.md b/pulumi-language-dotnet/testdata/sdks/any-type-function-15.0.0/README.md new file mode 100644 index 00000000..e69de29b diff --git a/pulumi-language-dotnet/testdata/sdks/any-type-function-15.0.0/Utilities.cs b/pulumi-language-dotnet/testdata/sdks/any-type-function-15.0.0/Utilities.cs new file mode 100644 index 00000000..49bf7e83 --- /dev/null +++ b/pulumi-language-dotnet/testdata/sdks/any-type-function-15.0.0/Utilities.cs @@ -0,0 +1,90 @@ +// *** WARNING: this file was generated by pulumi-language-dotnet. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +namespace Pulumi.AnyTypeFunction +{ + static class Utilities + { + public static string? GetEnv(params string[] names) + { + foreach (var n in names) + { + var value = global::System.Environment.GetEnvironmentVariable(n); + if (value != null) + { + return value; + } + } + return null; + } + + static string[] trueValues = { "1", "t", "T", "true", "TRUE", "True" }; + static string[] falseValues = { "0", "f", "F", "false", "FALSE", "False" }; + public static bool? GetEnvBoolean(params string[] names) + { + var s = GetEnv(names); + if (s != null) + { + if (global::System.Array.IndexOf(trueValues, s) != -1) + { + return true; + } + if (global::System.Array.IndexOf(falseValues, s) != -1) + { + return false; + } + } + return null; + } + + public static int? GetEnvInt32(params string[] names) => int.TryParse(GetEnv(names), out int v) ? (int?)v : null; + + public static double? GetEnvDouble(params string[] names) => double.TryParse(GetEnv(names), out double v) ? (double?)v : null; + + [global::System.Obsolete("Please use WithDefaults instead")] + public static global::Pulumi.InvokeOptions WithVersion(this global::Pulumi.InvokeOptions? options) + { + var dst = options ?? new global::Pulumi.InvokeOptions{}; + dst.Version = options?.Version ?? Version; + return dst; + } + + public static global::Pulumi.InvokeOptions WithDefaults(this global::Pulumi.InvokeOptions? src) + { + var dst = src ?? new global::Pulumi.InvokeOptions{}; + dst.Version = src?.Version ?? Version; + return dst; + } + + public static global::Pulumi.InvokeOutputOptions WithDefaults(this global::Pulumi.InvokeOutputOptions? src) + { + var dst = src ?? new global::Pulumi.InvokeOutputOptions{}; + dst.Version = src?.Version ?? Version; + return dst; + } + + private readonly static string version; + public static string Version => version; + + static Utilities() + { + var assembly = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(Utilities)).Assembly; + using var stream = assembly.GetManifestResourceStream("Pulumi.AnyTypeFunction.version.txt"); + using var reader = new global::System.IO.StreamReader(stream ?? throw new global::System.NotSupportedException("Missing embedded version.txt file")); + version = reader.ReadToEnd().Trim(); + var parts = version.Split("\n"); + if (parts.Length == 2) + { + // The first part is the provider name. + version = parts[1].Trim(); + } + } + } + + internal sealed class AnyTypeFunctionResourceTypeAttribute : global::Pulumi.ResourceTypeAttribute + { + public AnyTypeFunctionResourceTypeAttribute(string type) : base(type, Utilities.Version) + { + } + } +} diff --git a/pulumi-language-dotnet/testdata/sdks/any-type-function-15.0.0/logo.png b/pulumi-language-dotnet/testdata/sdks/any-type-function-15.0.0/logo.png new file mode 100644 index 00000000..181f421e Binary files /dev/null and b/pulumi-language-dotnet/testdata/sdks/any-type-function-15.0.0/logo.png differ diff --git a/pulumi-language-dotnet/testdata/sdks/any-type-function-15.0.0/pulumi-plugin.json b/pulumi-language-dotnet/testdata/sdks/any-type-function-15.0.0/pulumi-plugin.json new file mode 100644 index 00000000..1a993ca3 --- /dev/null +++ b/pulumi-language-dotnet/testdata/sdks/any-type-function-15.0.0/pulumi-plugin.json @@ -0,0 +1,5 @@ +{ + "resource": true, + "name": "any-type-function", + "version": "15.0.0" +} diff --git a/pulumi-language-dotnet/testdata/sdks/any-type-function-15.0.0/version.txt b/pulumi-language-dotnet/testdata/sdks/any-type-function-15.0.0/version.txt new file mode 100644 index 00000000..791fc94d --- /dev/null +++ b/pulumi-language-dotnet/testdata/sdks/any-type-function-15.0.0/version.txt @@ -0,0 +1 @@ +15.0.0 \ No newline at end of file diff --git a/pulumi-language-dotnet/testdata/sdks/component-13.3.7/ComponentCallable.cs b/pulumi-language-dotnet/testdata/sdks/component-13.3.7/ComponentCallable.cs new file mode 100644 index 00000000..4ac078e3 --- /dev/null +++ b/pulumi-language-dotnet/testdata/sdks/component-13.3.7/ComponentCallable.cs @@ -0,0 +1,113 @@ +// *** WARNING: this file was generated by pulumi-language-dotnet. *** +// *** 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.Component +{ + /// + /// A component resource that has callable methods. + /// + [ComponentResourceType("component:index:ComponentCallable")] + public partial class ComponentCallable : global::Pulumi.ComponentResource + { + [Output("value")] + public Output Value { get; private set; } = null!; + + + /// + /// Create a ComponentCallable resource with the given unique name, arguments, and options. + /// + /// + /// The unique name of the resource + /// The arguments used to populate this resource's properties + /// A bag of options that control this resource's behavior + public ComponentCallable(string name, ComponentCallableArgs args, ComponentResourceOptions? options = null) + : base("component:index:ComponentCallable", name, args ?? new ComponentCallableArgs(), MakeResourceOptions(options, ""), remote: true) + { + } + + private static ComponentResourceOptions MakeResourceOptions(ComponentResourceOptions? options, Input? id) + { + var defaultOptions = new ComponentResourceOptions + { + Version = Utilities.Version, + }; + var merged = ComponentResourceOptions.Merge(defaultOptions, options); + // Override the ID if one was specified for consistency with other language SDKs. + merged.Id = id ?? merged.Id; + return merged; + } + + /// + /// The `identity` method of the `ComponentCallable` component resource. Returns the component's `value` unaltered. + /// + public global::Pulumi.Output Identity() + => global::Pulumi.Deployment.Instance.Call("component:index:ComponentCallable/identity", CallArgs.Empty, this); + + /// + /// The `prefixed` method of the `ComponentCallable` component resource. Accepts a string and returns the component's `value` prefixed with that string. + /// + public global::Pulumi.Output Prefixed(ComponentCallablePrefixedArgs args) + => global::Pulumi.Deployment.Instance.Call("component:index:ComponentCallable/prefixed", args ?? new ComponentCallablePrefixedArgs(), this); + } + + public sealed class ComponentCallableArgs : global::Pulumi.ResourceArgs + { + [Input("value", required: true)] + public Input Value { get; set; } = null!; + + public ComponentCallableArgs() + { + } + public static new ComponentCallableArgs Empty => new ComponentCallableArgs(); + } + + /// + /// The results of the method. + /// + [OutputType] + public sealed class ComponentCallableIdentityResult + { + public readonly string Result; + + [OutputConstructor] + private ComponentCallableIdentityResult(string result) + { + Result = result; + } + } + + /// + /// The set of arguments for the method. + /// + public sealed class ComponentCallablePrefixedArgs : global::Pulumi.CallArgs + { + [Input("prefix", required: true)] + public Input Prefix { get; set; } = null!; + + public ComponentCallablePrefixedArgs() + { + } + public static new ComponentCallablePrefixedArgs Empty => new ComponentCallablePrefixedArgs(); + } + + /// + /// The results of the method. + /// + [OutputType] + public sealed class ComponentCallablePrefixedResult + { + public readonly string Result; + + [OutputConstructor] + private ComponentCallablePrefixedResult(string result) + { + Result = result; + } + } +} diff --git a/pulumi-language-dotnet/testdata/sdks/component-13.3.7/ComponentCustomRefInputOutput.cs b/pulumi-language-dotnet/testdata/sdks/component-13.3.7/ComponentCustomRefInputOutput.cs new file mode 100644 index 00000000..bddcbd06 --- /dev/null +++ b/pulumi-language-dotnet/testdata/sdks/component-13.3.7/ComponentCustomRefInputOutput.cs @@ -0,0 +1,60 @@ +// *** WARNING: this file was generated by pulumi-language-dotnet. *** +// *** 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.Component +{ + /// + /// A component resource that accepts a reference to a custom resource. The input resource's `value` is used to create a child custom resource inside the component, before a reference to this child is returned. + /// + [ComponentResourceType("component:index:ComponentCustomRefInputOutput")] + public partial class ComponentCustomRefInputOutput : global::Pulumi.ComponentResource + { + [Output("inputRef")] + public Output InputRef { get; private set; } = null!; + + [Output("outputRef")] + public Output OutputRef { get; private set; } = null!; + + + /// + /// Create a ComponentCustomRefInputOutput resource with the given unique name, arguments, and options. + /// + /// + /// The unique name of the resource + /// The arguments used to populate this resource's properties + /// A bag of options that control this resource's behavior + public ComponentCustomRefInputOutput(string name, ComponentCustomRefInputOutputArgs args, ComponentResourceOptions? options = null) + : base("component:index:ComponentCustomRefInputOutput", name, args ?? new ComponentCustomRefInputOutputArgs(), MakeResourceOptions(options, ""), remote: true) + { + } + + private static ComponentResourceOptions MakeResourceOptions(ComponentResourceOptions? options, Input? id) + { + var defaultOptions = new ComponentResourceOptions + { + Version = Utilities.Version, + }; + var merged = ComponentResourceOptions.Merge(defaultOptions, options); + // Override the ID if one was specified for consistency with other language SDKs. + merged.Id = id ?? merged.Id; + return merged; + } + } + + public sealed class ComponentCustomRefInputOutputArgs : global::Pulumi.ResourceArgs + { + [Input("inputRef", required: true)] + public Input InputRef { get; set; } = null!; + + public ComponentCustomRefInputOutputArgs() + { + } + public static new ComponentCustomRefInputOutputArgs Empty => new ComponentCustomRefInputOutputArgs(); + } +} diff --git a/pulumi-language-dotnet/testdata/sdks/component-13.3.7/ComponentCustomRefOutput.cs b/pulumi-language-dotnet/testdata/sdks/component-13.3.7/ComponentCustomRefOutput.cs new file mode 100644 index 00000000..a6848454 --- /dev/null +++ b/pulumi-language-dotnet/testdata/sdks/component-13.3.7/ComponentCustomRefOutput.cs @@ -0,0 +1,60 @@ +// *** WARNING: this file was generated by pulumi-language-dotnet. *** +// *** 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.Component +{ + /// + /// A component resource that accepts an input that is used to create a child custom resource. A reference to this child custom resource is returned. + /// + [ComponentResourceType("component:index:ComponentCustomRefOutput")] + public partial class ComponentCustomRefOutput : global::Pulumi.ComponentResource + { + [Output("ref")] + public Output Ref { get; private set; } = null!; + + [Output("value")] + public Output Value { get; private set; } = null!; + + + /// + /// Create a ComponentCustomRefOutput resource with the given unique name, arguments, and options. + /// + /// + /// The unique name of the resource + /// The arguments used to populate this resource's properties + /// A bag of options that control this resource's behavior + public ComponentCustomRefOutput(string name, ComponentCustomRefOutputArgs args, ComponentResourceOptions? options = null) + : base("component:index:ComponentCustomRefOutput", name, args ?? new ComponentCustomRefOutputArgs(), MakeResourceOptions(options, ""), remote: true) + { + } + + private static ComponentResourceOptions MakeResourceOptions(ComponentResourceOptions? options, Input? id) + { + var defaultOptions = new ComponentResourceOptions + { + Version = Utilities.Version, + }; + var merged = ComponentResourceOptions.Merge(defaultOptions, options); + // Override the ID if one was specified for consistency with other language SDKs. + merged.Id = id ?? merged.Id; + return merged; + } + } + + public sealed class ComponentCustomRefOutputArgs : global::Pulumi.ResourceArgs + { + [Input("value", required: true)] + public Input Value { get; set; } = null!; + + public ComponentCustomRefOutputArgs() + { + } + public static new ComponentCustomRefOutputArgs Empty => new ComponentCustomRefOutputArgs(); + } +} diff --git a/pulumi-language-dotnet/testdata/sdks/component-13.3.7/Custom.cs b/pulumi-language-dotnet/testdata/sdks/component-13.3.7/Custom.cs new file mode 100644 index 00000000..adf693d9 --- /dev/null +++ b/pulumi-language-dotnet/testdata/sdks/component-13.3.7/Custom.cs @@ -0,0 +1,74 @@ +// *** WARNING: this file was generated by pulumi-language-dotnet. *** +// *** 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.Component +{ + /// + /// A custom resource with a single string input and output + /// + [ComponentResourceType("component:index:Custom")] + public partial class Custom : global::Pulumi.CustomResource + { + [Output("value")] + public Output Value { get; private set; } = null!; + + + /// + /// Create a Custom resource with the given unique name, arguments, and options. + /// + /// + /// The unique name of the resource + /// The arguments used to populate this resource's properties + /// A bag of options that control this resource's behavior + public Custom(string name, CustomArgs args, CustomResourceOptions? options = null) + : base("component:index:Custom", name, args ?? new CustomArgs(), MakeResourceOptions(options, "")) + { + } + + private Custom(string name, Input id, CustomResourceOptions? options = null) + : base("component:index:Custom", name, null, MakeResourceOptions(options, id)) + { + } + + private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input? id) + { + var defaultOptions = new CustomResourceOptions + { + Version = Utilities.Version, + }; + 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; + } + /// + /// Get an existing Custom resource's state with the given name, ID, and optional extra + /// properties used to qualify the lookup. + /// + /// + /// The unique name of the resulting resource. + /// The unique provider ID of the resource to lookup. + /// A bag of options that control this resource's behavior + public static Custom Get(string name, Input id, CustomResourceOptions? options = null) + { + return new Custom(name, id, options); + } + } + + public sealed class CustomArgs : global::Pulumi.ResourceArgs + { + [Input("value", required: true)] + public Input Value { get; set; } = null!; + + public CustomArgs() + { + } + public static new CustomArgs Empty => new CustomArgs(); + } +} diff --git a/pulumi-language-dotnet/testdata/sdks/component-13.3.7/Provider.cs b/pulumi-language-dotnet/testdata/sdks/component-13.3.7/Provider.cs new file mode 100644 index 00000000..b3e30b7a --- /dev/null +++ b/pulumi-language-dotnet/testdata/sdks/component-13.3.7/Provider.cs @@ -0,0 +1,47 @@ +// *** WARNING: this file was generated by pulumi-language-dotnet. *** +// *** 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.Component +{ + [ComponentResourceType("pulumi:providers:component")] + public partial class Provider : global::Pulumi.ProviderResource + { + /// + /// Create a Provider resource with the given unique name, arguments, and options. + /// + /// + /// The unique name of the resource + /// The arguments used to populate this resource's properties + /// A bag of options that control this resource's behavior + public Provider(string name, ProviderArgs? args = null, CustomResourceOptions? options = null) + : base("component", name, args ?? new ProviderArgs(), MakeResourceOptions(options, "")) + { + } + + private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input? id) + { + var defaultOptions = new CustomResourceOptions + { + Version = Utilities.Version, + }; + 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; + } + } + + public sealed class ProviderArgs : global::Pulumi.ResourceArgs + { + public ProviderArgs() + { + } + public static new ProviderArgs Empty => new ProviderArgs(); + } +} diff --git a/pulumi-language-dotnet/testdata/sdks/component-13.3.7/Pulumi.Component.csproj b/pulumi-language-dotnet/testdata/sdks/component-13.3.7/Pulumi.Component.csproj new file mode 100644 index 00000000..be4ad583 --- /dev/null +++ b/pulumi-language-dotnet/testdata/sdks/component-13.3.7/Pulumi.Component.csproj @@ -0,0 +1,65 @@ + + + + true + Pulumi Corp. + Pulumi Corp. + + + + + logo.png + 13.3.7 + + net6.0 + enable + + + + true + 1701;1702;1591 + + + + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb + true + true + + + + true + + + + ROOT/artifacts/Pulumi;$(RestoreSources) + + + + + + + + + + + + + + + + + + + + + + + + + + True + + + + + diff --git a/pulumi-language-dotnet/testdata/sdks/component-13.3.7/README.md b/pulumi-language-dotnet/testdata/sdks/component-13.3.7/README.md new file mode 100644 index 00000000..e69de29b diff --git a/pulumi-language-dotnet/testdata/sdks/component-13.3.7/Utilities.cs b/pulumi-language-dotnet/testdata/sdks/component-13.3.7/Utilities.cs new file mode 100644 index 00000000..3671be11 --- /dev/null +++ b/pulumi-language-dotnet/testdata/sdks/component-13.3.7/Utilities.cs @@ -0,0 +1,90 @@ +// *** WARNING: this file was generated by pulumi-language-dotnet. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +namespace Pulumi.Component +{ + static class Utilities + { + public static string? GetEnv(params string[] names) + { + foreach (var n in names) + { + var value = global::System.Environment.GetEnvironmentVariable(n); + if (value != null) + { + return value; + } + } + return null; + } + + static string[] trueValues = { "1", "t", "T", "true", "TRUE", "True" }; + static string[] falseValues = { "0", "f", "F", "false", "FALSE", "False" }; + public static bool? GetEnvBoolean(params string[] names) + { + var s = GetEnv(names); + if (s != null) + { + if (global::System.Array.IndexOf(trueValues, s) != -1) + { + return true; + } + if (global::System.Array.IndexOf(falseValues, s) != -1) + { + return false; + } + } + return null; + } + + public static int? GetEnvInt32(params string[] names) => int.TryParse(GetEnv(names), out int v) ? (int?)v : null; + + public static double? GetEnvDouble(params string[] names) => double.TryParse(GetEnv(names), out double v) ? (double?)v : null; + + [global::System.Obsolete("Please use WithDefaults instead")] + public static global::Pulumi.InvokeOptions WithVersion(this global::Pulumi.InvokeOptions? options) + { + var dst = options ?? new global::Pulumi.InvokeOptions{}; + dst.Version = options?.Version ?? Version; + return dst; + } + + public static global::Pulumi.InvokeOptions WithDefaults(this global::Pulumi.InvokeOptions? src) + { + var dst = src ?? new global::Pulumi.InvokeOptions{}; + dst.Version = src?.Version ?? Version; + return dst; + } + + public static global::Pulumi.InvokeOutputOptions WithDefaults(this global::Pulumi.InvokeOutputOptions? src) + { + var dst = src ?? new global::Pulumi.InvokeOutputOptions{}; + dst.Version = src?.Version ?? Version; + return dst; + } + + private readonly static string version; + public static string Version => version; + + static Utilities() + { + var assembly = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(Utilities)).Assembly; + using var stream = assembly.GetManifestResourceStream("Pulumi.Component.version.txt"); + using var reader = new global::System.IO.StreamReader(stream ?? throw new global::System.NotSupportedException("Missing embedded version.txt file")); + version = reader.ReadToEnd().Trim(); + var parts = version.Split("\n"); + if (parts.Length == 2) + { + // The first part is the provider name. + version = parts[1].Trim(); + } + } + } + + internal sealed class ComponentResourceTypeAttribute : global::Pulumi.ResourceTypeAttribute + { + public ComponentResourceTypeAttribute(string type) : base(type, Utilities.Version) + { + } + } +} diff --git a/pulumi-language-dotnet/testdata/sdks/component-13.3.7/logo.png b/pulumi-language-dotnet/testdata/sdks/component-13.3.7/logo.png new file mode 100644 index 00000000..181f421e Binary files /dev/null and b/pulumi-language-dotnet/testdata/sdks/component-13.3.7/logo.png differ diff --git a/pulumi-language-dotnet/testdata/sdks/component-13.3.7/pulumi-plugin.json b/pulumi-language-dotnet/testdata/sdks/component-13.3.7/pulumi-plugin.json new file mode 100644 index 00000000..6ee1dad8 --- /dev/null +++ b/pulumi-language-dotnet/testdata/sdks/component-13.3.7/pulumi-plugin.json @@ -0,0 +1,5 @@ +{ + "resource": true, + "name": "component", + "version": "13.3.7" +} diff --git a/pulumi-language-dotnet/testdata/sdks/component-13.3.7/version.txt b/pulumi-language-dotnet/testdata/sdks/component-13.3.7/version.txt new file mode 100644 index 00000000..1faeb11c --- /dev/null +++ b/pulumi-language-dotnet/testdata/sdks/component-13.3.7/version.txt @@ -0,0 +1 @@ +13.3.7 \ No newline at end of file