diff --git a/provider/provider_python_test.go b/provider/provider_python_test.go index 4d4633fe55e..82022d16e80 100644 --- a/provider/provider_python_test.go +++ b/provider/provider_python_test.go @@ -36,6 +36,30 @@ func TestRegress3196(t *testing.T) { }) } +func TestRegress3887(t *testing.T) { + if testing.Short() { + t.Skipf("Skipping test in -short mode because it needs cloud credentials") + return + } + test := getPythonBaseOptions(t). + With(integration.ProgramTestOptions{ + Quick: true, + SkipRefresh: true, + Dir: filepath.Join("test-programs", "regress-3887"), + EditDirs: []integration.EditDir{ + { + Dir: filepath.Join("test-programs", "regress-3887", "step-1"), + Additive: true, + }, + { + Dir: filepath.Join("test-programs", "regress-3887", "step-2"), + Additive: true, + }, + }, + }) + integration.ProgramTest(t, &test) +} + func TestRegress1504(t *testing.T) { if testing.Short() { t.Skipf("Skipping test in -short mode because it needs cloud credentials") diff --git a/provider/resources.go b/provider/resources.go index 1250741fab9..1f76f8a6be1 100644 --- a/provider/resources.go +++ b/provider/resources.go @@ -803,7 +803,8 @@ func ProviderFromMeta(metaInfo *tfbridge.MetadataInfo) *tfbridge.ProviderInfo { switch s { case "aws_ssm_document", "aws_wafv2_web_acl", - "aws_launch_template": + "aws_launch_template", + "aws_batch_job_definition": return true default: return false diff --git a/provider/test-programs/regress-3887/Pulumi.yaml b/provider/test-programs/regress-3887/Pulumi.yaml new file mode 100644 index 00000000000..916e25eedbf --- /dev/null +++ b/provider/test-programs/regress-3887/Pulumi.yaml @@ -0,0 +1,5 @@ +name: regress-3887 +runtime: + name: python + options: + virtualenv: venv diff --git a/provider/test-programs/regress-3887/__main__.py b/provider/test-programs/regress-3887/__main__.py new file mode 100644 index 00000000000..ddf975e3016 --- /dev/null +++ b/provider/test-programs/regress-3887/__main__.py @@ -0,0 +1,55 @@ +import json +import pulumi_aws as aws + +test = aws.batch.JobDefinition( + "test", + name="my_test_batch_job_definition", + type="container", + container_properties=json.dumps( + { + "command": [ + "ls", + "-la", + ], + "image": "busybox", + "resourceRequirements": [ + { + "type": "VCPU", + "value": "1", + }, + { + "type": "MEMORY", + "value": "512", + }, + ], + "volumes": [ + { + "host": { + "sourcePath": "/tmp", + }, + "name": "tmp", + } + ], + "environment": [ + { + "name": "VARNAME", + "value": "VARVAL", + } + ], + "mountPoints": [ + { + "sourceVolume": "tmp", + "containerPath": "/tmp", + "readOnly": False, + } + ], + "ulimits": [ + { + "hardLimit": 1024, + "name": "nofile", + "softLimit": 1024, + } + ], + } + ), +) diff --git a/provider/test-programs/regress-3887/requirements.txt b/provider/test-programs/regress-3887/requirements.txt new file mode 100644 index 00000000000..e032db624ae --- /dev/null +++ b/provider/test-programs/regress-3887/requirements.txt @@ -0,0 +1,2 @@ +pulumi>=3.0.0,<4.0.0 +pulumi_aws>=6.0.0,<7.0.0 diff --git a/provider/test-programs/regress-3887/step-1/__main__.py b/provider/test-programs/regress-3887/step-1/__main__.py new file mode 100644 index 00000000000..5dfe7c692ae --- /dev/null +++ b/provider/test-programs/regress-3887/step-1/__main__.py @@ -0,0 +1,55 @@ +import json +import pulumi_aws as aws + +test = aws.batch.JobDefinition( + "test", + name="my_test_batch_job_definition", + type="container", + container_properties=json.dumps( + { + "command": [ + "ls", + "-la", + ], + "image": "busybox", + "resourceRequirements": [ + { + "type": "VCPU", + "value": "2", + }, + { + "type": "MEMORY", + "value": "512", + }, + ], + "volumes": [ + { + "host": { + "sourcePath": "/tmp", + }, + "name": "tmp", + } + ], + "environment": [ + { + "name": "VARNAME", + "value": "VARVAL", + } + ], + "mountPoints": [ + { + "sourceVolume": "tmp", + "containerPath": "/tmp", + "readOnly": False, + } + ], + "ulimits": [ + { + "hardLimit": 1024, + "name": "nofile", + "softLimit": 1024, + } + ], + } + ), +) diff --git a/provider/test-programs/regress-3887/step-2/__main__.py b/provider/test-programs/regress-3887/step-2/__main__.py new file mode 100644 index 00000000000..cf33747f1f7 --- /dev/null +++ b/provider/test-programs/regress-3887/step-2/__main__.py @@ -0,0 +1,55 @@ +import json +import pulumi_aws as aws + +test = aws.batch.JobDefinition( + "test", + name="my_test_batch_job_definition", + type="container", + container_properties=json.dumps( + { + "command": [ + "ls", + "-la", + ], + "image": "busybox", + "resourceRequirements": [ + { + "type": "VCPU", + "value": "3", + }, + { + "type": "MEMORY", + "value": "512", + }, + ], + "volumes": [ + { + "host": { + "sourcePath": "/tmp", + }, + "name": "tmp", + } + ], + "environment": [ + { + "name": "VARNAME", + "value": "VARVAL", + } + ], + "mountPoints": [ + { + "sourceVolume": "tmp", + "containerPath": "/tmp", + "readOnly": False, + } + ], + "ulimits": [ + { + "hardLimit": 1024, + "name": "nofile", + "softLimit": 1024, + } + ], + } + ), +)