Skip to content

Commit ebb3cff

Browse files
committed
Updated context
1 parent 810d173 commit ebb3cff

File tree

13 files changed

+1971
-1970
lines changed

13 files changed

+1971
-1970
lines changed

context/awslambda.tf

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -326,15 +326,15 @@ resource "octopusdeploy_process_step" "process_step_aws_lambda_attempt_login" {
326326
properties = {
327327
}
328328
execution_properties = {
329-
"Octopus.Action.Script.ScriptBody" = "# Get the current AWS user. This will only succeed if the AWS account is valid.\n# If the AWS account is not valid, this step will fail. We can detect the failure and offer next steps.\naws sts get-caller-identity"
330329
"OctopusUseBundledTooling" = "False"
331-
"Octopus.Action.Script.Syntax" = "PowerShell"
332-
"Octopus.Action.Aws.Region" = "#{Project.AWS.Region}"
333330
"Octopus.Action.Aws.AssumeRole" = "False"
334-
"Octopus.Action.AwsAccount.Variable" = "Project.AWS.Account"
335-
"Octopus.Action.AwsAccount.UseInstanceRole" = "False"
331+
"Octopus.Action.Aws.Region" = "#{Project.AWS.Region}"
336332
"Octopus.Action.Script.ScriptSource" = "Inline"
333+
"Octopus.Action.Script.Syntax" = "PowerShell"
337334
"Octopus.Action.RunOnServer" = "true"
335+
"Octopus.Action.Script.ScriptBody" = "# Get the current AWS user. This will only succeed if the AWS account is valid.\n# If the AWS account is not valid, this step will fail. We can detect the failure and offer next steps.\naws sts get-caller-identity"
336+
"Octopus.Action.AwsAccount.UseInstanceRole" = "False"
337+
"Octopus.Action.AwsAccount.Variable" = "Project.AWS.Account"
338338
}
339339
}
340340

@@ -357,11 +357,11 @@ resource "octopusdeploy_process_step" "process_step_aws_lambda_validate_setup" {
357357
properties = {
358358
}
359359
execution_properties = {
360+
"Octopus.Action.Script.ScriptFileName" = "octopus/aws/ValidateLambdaSetup.ps1"
361+
"Octopus.Action.Script.ScriptSource" = "GitRepository"
360362
"OctopusUseBundledTooling" = "False"
361363
"Octopus.Action.RunOnServer" = "true"
362364
"Octopus.Action.GitRepository.Source" = "External"
363-
"Octopus.Action.Script.ScriptFileName" = "octopus/aws/ValidateLambdaSetup.ps1"
364-
"Octopus.Action.Script.ScriptSource" = "GitRepository"
365365
}
366366
}
367367

@@ -383,9 +383,9 @@ resource "octopusdeploy_process_step" "process_step_aws_lambda_approve_productio
383383
"Octopus.Step.ConditionVariableExpression" = "#{unless Octopus.Deployment.Error}#{if Octopus.Action[Validate setup].Output.AwsLambdaConfigured == \"True\"}true#{/if}#{/unless}"
384384
}
385385
execution_properties = {
386-
"Octopus.Action.Manual.Instructions" = "Do you approve the production deployment?"
387386
"Octopus.Action.RunOnServer" = "true"
388387
"Octopus.Action.Manual.BlockConcurrentDeployments" = "False"
388+
"Octopus.Action.Manual.Instructions" = "Do you approve the production deployment?"
389389
}
390390
}
391391

@@ -417,26 +417,26 @@ resource "octopusdeploy_process_step" "process_step_aws_lambda_upload_lambda" {
417417
"Octopus.Step.ConditionVariableExpression" = "#{unless Octopus.Deployment.Error}#{if Octopus.Action[Validate setup].Output.AwsLambdaConfigured == \"True\"}true#{/if}#{/unless}"
418418
}
419419
execution_properties = {
420-
"Octopus.Action.AwsAccount.UseInstanceRole" = "False"
421-
"Octopus.Action.RunOnServer" = "true"
422420
"Octopus.Action.Aws.S3.BucketName" = "#{Project.AWS.Lambda.S3.BucketName}"
421+
"Octopus.Action.AwsAccount.Variable" = "Project.AWS.Account"
422+
"Octopus.Action.Aws.S3.TargetMode" = "EntirePackage"
423423
"OctopusUseBundledTooling" = "False"
424+
"Octopus.Action.Aws.Region" = "#{Project.AWS.Region}"
425+
"Octopus.Action.RunOnServer" = "true"
426+
"Octopus.Action.Aws.AssumeRole" = "False"
427+
"Octopus.Action.AwsAccount.UseInstanceRole" = "False"
424428
"Octopus.Action.Aws.S3.PackageOptions" = jsonencode({
425-
"cannedAcl" = "private"
429+
"bucketKey" = "#{Project.AWS.Lambda.S3.FileName}"
430+
"storageClass" = "STANDARD"
426431
"metadata" = []
427432
"tags" = []
428-
"bucketKey" = "#{Project.AWS.Lambda.S3.FileName}"
429433
"bucketKeyBehaviour" = "Custom"
434+
"bucketKeyPrefix" = ""
435+
"cannedAcl" = "private"
430436
"variableSubstitutionPatterns" = ""
431437
"structuredVariableSubstitutionPatterns" = ""
432438
"autoFocus" = "true"
433-
"bucketKeyPrefix" = ""
434-
"storageClass" = "STANDARD"
435439
})
436-
"Octopus.Action.Aws.Region" = "#{Project.AWS.Region}"
437-
"Octopus.Action.AwsAccount.Variable" = "Project.AWS.Account"
438-
"Octopus.Action.Aws.AssumeRole" = "False"
439-
"Octopus.Action.Aws.S3.TargetMode" = "EntirePackage"
440440
}
441441
}
442442

@@ -468,21 +468,10 @@ resource "octopusdeploy_process_step" "process_step_aws_lambda_deploy_lambda_sam
468468
"Octopus.Step.ConditionVariableExpression" = "#{unless Octopus.Deployment.Error}#{if Octopus.Action[Validate setup].Output.AwsLambdaConfigured == \"True\"}true#{/if}#{/unless}"
469469
}
470470
execution_properties = {
471-
"Octopus.Action.Aws.IamCapabilities" = jsonencode([
472-
"CAPABILITY_AUTO_EXPAND",
473-
"CAPABILITY_IAM",
474-
"CAPABILITY_NAMED_IAM",
475-
])
476-
"Octopus.Action.AwsAccount.UseInstanceRole" = "False"
477-
"Octopus.Action.EnabledFeatures" = "Octopus.Features.JsonConfigurationVariables"
478-
"Octopus.Action.RunOnServer" = "true"
479-
"Octopus.Action.AwsAccount.Variable" = "Project.AWS.Account"
480-
"OctopusUseBundledTooling" = "False"
481-
"Octopus.Action.Aws.Region" = "#{Project.AWS.Region}"
482471
"Octopus.Action.Aws.CloudFormation.Tags" = jsonencode([
483472
{
484-
"key" = "OctopusTenantId"
485473
"value" = "#{if Octopus.Deployment.Tenant.Id}#{Octopus.Deployment.Tenant.Id}#{/if}#{unless Octopus.Deployment.Tenant.Id}untenanted#{/unless}"
474+
"key" = "OctopusTenantId"
486475
},
487476
{
488477
"key" = "OctopusStepId"
@@ -509,16 +498,27 @@ resource "octopusdeploy_process_step" "process_step_aws_lambda_deploy_lambda_sam
509498
"value" = "#{Octopus.Environment.Name}"
510499
},
511500
{
512-
"value" = "#{Octopus.Project.Name}"
513501
"key" = "DeploymentProject"
502+
"value" = "#{Octopus.Project.Name}"
514503
},
515504
])
516-
"Octopus.Action.Aws.WaitForCompletion" = "True"
517-
"Octopus.Action.Aws.AssumeRole" = "False"
518505
"Octopus.Action.Aws.TemplateSource" = "Package"
506+
"Octopus.Action.Aws.AssumeRole" = "False"
507+
"OctopusUseBundledTooling" = "False"
519508
"Octopus.Action.Package.JsonConfigurationVariablesTargets" = "sam.jvm.yaml"
520-
"Octopus.Action.Aws.CloudFormationTemplate" = "sam.jvm.yaml"
509+
"Octopus.Action.AwsAccount.UseInstanceRole" = "False"
510+
"Octopus.Action.Aws.IamCapabilities" = jsonencode([
511+
"CAPABILITY_AUTO_EXPAND",
512+
"CAPABILITY_IAM",
513+
"CAPABILITY_NAMED_IAM",
514+
])
515+
"Octopus.Action.Aws.WaitForCompletion" = "True"
516+
"Octopus.Action.EnabledFeatures" = "Octopus.Features.JsonConfigurationVariables"
517+
"Octopus.Action.Aws.Region" = "#{Project.AWS.Region}"
518+
"Octopus.Action.RunOnServer" = "true"
521519
"Octopus.Action.Aws.CloudFormationStackName" = "#{Octopus.Space.Name | Replace \"[^A-Za-z0-9]\" \"-\"}-OctopubProductsSAMLambda-#{Octopus.Deployment.Id | Replace -}-#{Octopus.Environment.Name}"
520+
"Octopus.Action.AwsAccount.Variable" = "Project.AWS.Account"
521+
"Octopus.Action.Aws.CloudFormationTemplate" = "sam.jvm.yaml"
522522
}
523523
}
524524

@@ -549,11 +549,11 @@ resource "octopusdeploy_process_step" "process_step_aws_lambda_scan_for_vulnerab
549549
properties = {
550550
}
551551
execution_properties = {
552+
"OctopusUseBundledTooling" = "False"
552553
"Octopus.Action.RunOnServer" = "true"
553554
"Octopus.Action.GitRepository.Source" = "External"
554555
"Octopus.Action.Script.ScriptFileName" = "octopus/DirectorySbomScan.ps1"
555556
"Octopus.Action.Script.ScriptSource" = "GitRepository"
556-
"OctopusUseBundledTooling" = "False"
557557
}
558558
}
559559

context/azurefunction.tf

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -327,12 +327,12 @@ resource "octopusdeploy_process_step" "process_step_azure_function_validate_setu
327327
properties = {
328328
}
329329
execution_properties = {
330-
"Octopus.Action.Script.ScriptParameters" = "-Role \"Octopub-Products-Function\" -CheckForTargets $true"
331-
"Octopus.Action.Script.ScriptSource" = "GitRepository"
332-
"OctopusUseBundledTooling" = "False"
333330
"Octopus.Action.RunOnServer" = "true"
334331
"Octopus.Action.GitRepository.Source" = "External"
335332
"Octopus.Action.Script.ScriptFileName" = "octopus/Azure/ValidateSetup.ps1"
333+
"Octopus.Action.Script.ScriptParameters" = "-Role \"Octopub-Products-Function\" -CheckForTargets $true"
334+
"Octopus.Action.Script.ScriptSource" = "GitRepository"
335+
"OctopusUseBundledTooling" = "False"
336336
}
337337
}
338338

@@ -355,11 +355,11 @@ resource "octopusdeploy_process_step" "process_step_azure_function_check_smtp_co
355355
properties = {
356356
}
357357
execution_properties = {
358+
"Octopus.Action.Script.ScriptFileName" = "octopus/CheckSMTPConfigured.ps1"
359+
"Octopus.Action.Script.ScriptSource" = "GitRepository"
358360
"OctopusUseBundledTooling" = "False"
359361
"Octopus.Action.RunOnServer" = "true"
360362
"Octopus.Action.GitRepository.Source" = "External"
361-
"Octopus.Action.Script.ScriptFileName" = "octopus/CheckSMTPConfigured.ps1"
362-
"Octopus.Action.Script.ScriptSource" = "GitRepository"
363363
}
364364
}
365365

@@ -390,11 +390,11 @@ resource "octopusdeploy_process_step" "process_step_azure_function_deploy_produc
390390
"Octopus.Action.TargetRoles" = "Octopub-Products-Function"
391391
}
392392
execution_properties = {
393-
"Octopus.Action.Azure.DeploymentType" = "Package"
393+
"Octopus.Action.RunOnServer" = "true"
394394
"OctopusUseBundledTooling" = "False"
395395
"Octopus.Action.Azure.DeploymentSlot" = "staging"
396+
"Octopus.Action.Azure.DeploymentType" = "Package"
396397
"Octopus.Action.EnabledFeatures" = "Octopus.Features.JsonConfigurationVariables,Octopus.Features.ConfigurationTransforms,Octopus.Features.SubstituteInFiles"
397-
"Octopus.Action.RunOnServer" = "true"
398398
}
399399
}
400400

@@ -470,12 +470,12 @@ resource "octopusdeploy_process_step" "process_step_azure_function_swap_deployme
470470
"Octopus.Step.ConditionVariableExpression" = "#{unless Octopus.Deployment.Error}#{if Octopus.Action[Validate Setup].Output.SetupValid == \"True\"}true#{/if}#{/unless}"
471471
}
472472
execution_properties = {
473-
"Octopus.Action.RunOnServer" = "true"
474-
"Octopus.Action.Azure.AccountId" = "#{Project.Azure.Account}"
475-
"Octopus.Action.Script.ScriptBody" = "# Get variables\n$resourceGroupName = $OctopusParameters[\"Project.Azure.ResourceGroup.Name\"]\n$functionAppName = $OctopusParameters[\"Project.Azure.Function.Octopub.Products.Name\"]\n\n# Swap the staging and production slots\nWrite-Host \"Swapping Staging and Production slots...\"\naz functionapp deployment slot swap --slot \"Staging\" --target-slot \"Production\" --resource-group $resourceGroupName --name $functionAppName\nWrite-Host \"Swap complete!\""
476473
"Octopus.Action.Script.ScriptSource" = "Inline"
477474
"Octopus.Action.Script.Syntax" = "PowerShell"
478475
"OctopusUseBundledTooling" = "False"
476+
"Octopus.Action.RunOnServer" = "true"
477+
"Octopus.Action.Azure.AccountId" = "#{Project.Azure.Account}"
478+
"Octopus.Action.Script.ScriptBody" = "# Get variables\n$resourceGroupName = $OctopusParameters[\"Project.Azure.ResourceGroup.Name\"]\n$functionAppName = $OctopusParameters[\"Project.Azure.Function.Octopub.Products.Name\"]\n\n# Swap the staging and production slots\nWrite-Host \"Swapping Staging and Production slots...\"\naz functionapp deployment slot swap --slot \"Staging\" --target-slot \"Production\" --resource-group $resourceGroupName --name $functionAppName\nWrite-Host \"Swap complete!\""
479479
}
480480
}
481481

@@ -506,11 +506,11 @@ resource "octopusdeploy_process_step" "process_step_azure_function_scan_for_vuln
506506
properties = {
507507
}
508508
execution_properties = {
509+
"Octopus.Action.RunOnServer" = "true"
510+
"Octopus.Action.GitRepository.Source" = "External"
509511
"Octopus.Action.Script.ScriptFileName" = "octopus/DirectorySbomScan.ps1"
510512
"Octopus.Action.Script.ScriptSource" = "GitRepository"
511513
"OctopusUseBundledTooling" = "False"
512-
"Octopus.Action.RunOnServer" = "true"
513-
"Octopus.Action.GitRepository.Source" = "External"
514514
}
515515
}
516516

0 commit comments

Comments
 (0)