Skip to content

Commit 5caadfb

Browse files
committed
Updated context
1 parent ebb3cff commit 5caadfb

File tree

13 files changed

+1739
-1739
lines changed

13 files changed

+1739
-1739
lines changed

context/awslambda.tf

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -327,13 +327,13 @@ resource "octopusdeploy_process_step" "process_step_aws_lambda_attempt_login" {
327327
}
328328
execution_properties = {
329329
"OctopusUseBundledTooling" = "False"
330-
"Octopus.Action.Aws.AssumeRole" = "False"
330+
"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"
331331
"Octopus.Action.Aws.Region" = "#{Project.AWS.Region}"
332332
"Octopus.Action.Script.ScriptSource" = "Inline"
333333
"Octopus.Action.Script.Syntax" = "PowerShell"
334-
"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"
334+
"Octopus.Action.Aws.AssumeRole" = "False"
336335
"Octopus.Action.AwsAccount.UseInstanceRole" = "False"
336+
"Octopus.Action.RunOnServer" = "true"
337337
"Octopus.Action.AwsAccount.Variable" = "Project.AWS.Account"
338338
}
339339
}
@@ -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"
362360
"OctopusUseBundledTooling" = "False"
363361
"Octopus.Action.RunOnServer" = "true"
364362
"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?"
386387
"Octopus.Action.RunOnServer" = "true"
387388
"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.Aws.S3.BucketName" = "#{Project.AWS.Lambda.S3.BucketName}"
421-
"Octopus.Action.AwsAccount.Variable" = "Project.AWS.Account"
422-
"Octopus.Action.Aws.S3.TargetMode" = "EntirePackage"
423-
"OctopusUseBundledTooling" = "False"
424-
"Octopus.Action.Aws.Region" = "#{Project.AWS.Region}"
425-
"Octopus.Action.RunOnServer" = "true"
426-
"Octopus.Action.Aws.AssumeRole" = "False"
427420
"Octopus.Action.AwsAccount.UseInstanceRole" = "False"
428421
"Octopus.Action.Aws.S3.PackageOptions" = jsonencode({
429-
"bucketKey" = "#{Project.AWS.Lambda.S3.FileName}"
422+
"bucketKeyBehaviour" = "Custom"
430423
"storageClass" = "STANDARD"
431-
"metadata" = []
424+
"cannedAcl" = "private"
432425
"tags" = []
433-
"bucketKeyBehaviour" = "Custom"
426+
"autoFocus" = "true"
434427
"bucketKeyPrefix" = ""
435-
"cannedAcl" = "private"
436428
"variableSubstitutionPatterns" = ""
437429
"structuredVariableSubstitutionPatterns" = ""
438-
"autoFocus" = "true"
430+
"metadata" = []
431+
"bucketKey" = "#{Project.AWS.Lambda.S3.FileName}"
439432
})
433+
"Octopus.Action.Aws.AssumeRole" = "False"
434+
"Octopus.Action.AwsAccount.Variable" = "Project.AWS.Account"
435+
"Octopus.Action.RunOnServer" = "true"
436+
"Octopus.Action.Aws.S3.TargetMode" = "EntirePackage"
437+
"OctopusUseBundledTooling" = "False"
438+
"Octopus.Action.Aws.S3.BucketName" = "#{Project.AWS.Lambda.S3.BucketName}"
439+
"Octopus.Action.Aws.Region" = "#{Project.AWS.Region}"
440440
}
441441
}
442442

@@ -468,10 +468,24 @@ 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.EnabledFeatures" = "Octopus.Features.JsonConfigurationVariables"
472+
"OctopusUseBundledTooling" = "False"
473+
"Octopus.Action.Aws.IamCapabilities" = jsonencode([
474+
"CAPABILITY_AUTO_EXPAND",
475+
"CAPABILITY_IAM",
476+
"CAPABILITY_NAMED_IAM",
477+
])
478+
"Octopus.Action.AwsAccount.Variable" = "Project.AWS.Account"
479+
"Octopus.Action.Aws.CloudFormationTemplate" = "sam.jvm.yaml"
480+
"Octopus.Action.Aws.AssumeRole" = "False"
481+
"Octopus.Action.Aws.WaitForCompletion" = "True"
482+
"Octopus.Action.AwsAccount.UseInstanceRole" = "False"
483+
"Octopus.Action.Aws.Region" = "#{Project.AWS.Region}"
484+
"Octopus.Action.RunOnServer" = "true"
471485
"Octopus.Action.Aws.CloudFormation.Tags" = jsonencode([
472486
{
473-
"value" = "#{if Octopus.Deployment.Tenant.Id}#{Octopus.Deployment.Tenant.Id}#{/if}#{unless Octopus.Deployment.Tenant.Id}untenanted#{/unless}"
474487
"key" = "OctopusTenantId"
488+
"value" = "#{if Octopus.Deployment.Tenant.Id}#{Octopus.Deployment.Tenant.Id}#{/if}#{unless Octopus.Deployment.Tenant.Id}untenanted#{/unless}"
475489
},
476490
{
477491
"key" = "OctopusStepId"
@@ -490,8 +504,8 @@ resource "octopusdeploy_process_step" "process_step_aws_lambda_deploy_lambda_sam
490504
"value" = "#{Octopus.Project.Id}"
491505
},
492506
{
493-
"value" = "#{Octopus.Environment.Id}"
494507
"key" = "OctopusEnvironmentId"
508+
"value" = "#{Octopus.Environment.Id}"
495509
},
496510
{
497511
"key" = "Environment"
@@ -502,23 +516,9 @@ resource "octopusdeploy_process_step" "process_step_aws_lambda_deploy_lambda_sam
502516
"value" = "#{Octopus.Project.Name}"
503517
},
504518
])
505-
"Octopus.Action.Aws.TemplateSource" = "Package"
506-
"Octopus.Action.Aws.AssumeRole" = "False"
507-
"OctopusUseBundledTooling" = "False"
508-
"Octopus.Action.Package.JsonConfigurationVariablesTargets" = "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"
519519
"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"
520+
"Octopus.Action.Package.JsonConfigurationVariablesTargets" = "sam.jvm.yaml"
521+
"Octopus.Action.Aws.TemplateSource" = "Package"
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"
553-
"Octopus.Action.RunOnServer" = "true"
554552
"Octopus.Action.GitRepository.Source" = "External"
555553
"Octopus.Action.Script.ScriptFileName" = "octopus/DirectorySbomScan.ps1"
556554
"Octopus.Action.Script.ScriptSource" = "GitRepository"
555+
"OctopusUseBundledTooling" = "False"
556+
"Octopus.Action.RunOnServer" = "true"
557557
}
558558
}
559559

context/azurefunction.tf

Lines changed: 11 additions & 11 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.ScriptSource" = "GitRepository"
331+
"OctopusUseBundledTooling" = "False"
330332
"Octopus.Action.RunOnServer" = "true"
331333
"Octopus.Action.GitRepository.Source" = "External"
332334
"Octopus.Action.Script.ScriptFileName" = "octopus/Azure/ValidateSetup.ps1"
333335
"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.RunOnServer" = "true"
359+
"Octopus.Action.GitRepository.Source" = "External"
358360
"Octopus.Action.Script.ScriptFileName" = "octopus/CheckSMTPConfigured.ps1"
359361
"Octopus.Action.Script.ScriptSource" = "GitRepository"
360362
"OctopusUseBundledTooling" = "False"
361-
"Octopus.Action.RunOnServer" = "true"
362-
"Octopus.Action.GitRepository.Source" = "External"
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.RunOnServer" = "true"
394393
"OctopusUseBundledTooling" = "False"
395394
"Octopus.Action.Azure.DeploymentSlot" = "staging"
396-
"Octopus.Action.Azure.DeploymentType" = "Package"
397395
"Octopus.Action.EnabledFeatures" = "Octopus.Features.JsonConfigurationVariables,Octopus.Features.ConfigurationTransforms,Octopus.Features.SubstituteInFiles"
396+
"Octopus.Action.RunOnServer" = "true"
397+
"Octopus.Action.Azure.DeploymentType" = "Package"
398398
}
399399
}
400400

@@ -417,12 +417,12 @@ resource "octopusdeploy_process_step" "process_step_azure_function_smoke_test" {
417417
"Octopus.Step.ConditionVariableExpression" = "#{unless Octopus.Deployment.Error}#{if Octopus.Action[Validate Setup].Output.SetupValid == \"True\"}true#{/if}#{/unless}"
418418
}
419419
execution_properties = {
420-
"Octopus.Action.Script.ScriptSource" = "Inline"
421-
"Octopus.Action.Script.Syntax" = "PowerShell"
422420
"OctopusUseBundledTooling" = "False"
423421
"Octopus.Action.RunOnServer" = "true"
424422
"Octopus.Action.Azure.AccountId" = "#{Project.Azure.Account}"
425423
"Octopus.Action.Script.ScriptBody" = "# Get variables\n$resourceGroupName = \"#{Project.Azure.ResourceGroup.Name}\"\n$functionName = \"#{Project.Azure.Function.Octopub.Products.Name}\"\n\n# Get list of deployment slots\n$deploymentSlots = (az functionapp deployment slot list --resource-group $resourceGroupName --name $functionName | ConvertFrom-JSON)\n\n# Check to see if anything was returned\nif ($null -ne $deploymentSlots -and $null -ne ($deploymentSlots | Where-Object {$_.Name -eq \"staging\"}))\n{\n # Assing the hostname of the deployment slot\n $testUrl = ($deploymentSlots | Where-Object {$_.Name -eq \"staging\"}).defaultHostName\n}\nelse\n{\n # No deployments slots are available, use the function app instead\n $testUrl = (az functionapp show --resource-group $resourceGroupName --name $functionName | ConvertFrom-JSON).defaultHostName\n}\n\ntry\n{\n # Make a web request \n $response = Invoke-WebRequest -Uri \"https://$testUrl\"\n\n # Check for a 200 response\n if ($response.StatusCode -ne 200)\n {\n # Throw an error\n throw $response.StatusCode\n }\n else\n {\n Write-Host \"Smoke test succeeded!\"\n }\n}\ncatch\n{\n Write-Warning \"An error occurred: $($_.Exception.Message)\"\n}"
424+
"Octopus.Action.Script.ScriptSource" = "Inline"
425+
"Octopus.Action.Script.Syntax" = "PowerShell"
426426
}
427427
}
428428

@@ -443,10 +443,10 @@ resource "octopusdeploy_process_step" "process_step_azure_function_manual_approv
443443
properties = {
444444
}
445445
execution_properties = {
446-
"Octopus.Action.Manual.BlockConcurrentDeployments" = "False"
447446
"Octopus.Action.Manual.Instructions" = "Please review the Staging slot for the function apps"
448447
"Octopus.Action.Manual.ResponsibleTeamIds" = "teams-managers"
449448
"Octopus.Action.RunOnServer" = "true"
449+
"Octopus.Action.Manual.BlockConcurrentDeployments" = "False"
450450
}
451451
}
452452

@@ -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"
511509
"Octopus.Action.Script.ScriptFileName" = "octopus/DirectorySbomScan.ps1"
512510
"Octopus.Action.Script.ScriptSource" = "GitRepository"
513511
"OctopusUseBundledTooling" = "False"
512+
"Octopus.Action.RunOnServer" = "true"
513+
"Octopus.Action.GitRepository.Source" = "External"
514514
}
515515
}
516516

0 commit comments

Comments
 (0)