fix bucket bug + comtoffx
This commit is contained in:
Родитель
2e7389fda9
Коммит
63cd992e7a
Двоичные данные
DataConnectors/AWS-S3/ConfigAwsS3DataConnectorScripts.zip
Двоичные данные
DataConnectors/AWS-S3/ConfigAwsS3DataConnectorScripts.zip
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичные данные
DataConnectors/AWS-S3/ConfigAwsS3DataConnectorScriptsGov.zip
Двоичные данные
DataConnectors/AWS-S3/ConfigAwsS3DataConnectorScriptsGov.zip
Двоичный файл не отображается.
|
@ -1,10 +1,17 @@
|
|||
#GovToFFX
|
||||
#$script:SentinelClientId = 'api://d4230588-5f84-4281-a9c7-2c15194b28f7'
|
||||
#$script:SentinelTenantId = 'cab8a31a-1906-4287-a0d8-4eef66b95f6e'
|
||||
#$script:CloudEnv = 'Gov'
|
||||
#$script:AwsCloudResource = 'arn:aws-us-gov'
|
||||
|
||||
|
||||
#ComToProd
|
||||
$script:SentinelClientId = 'api://1462b192-27f7-4cb9-8523-0f4ecb54b47e'
|
||||
$script:SentinelTenantId = '33e01921-4d64-4f8c-a055-5bdaffd5e33d'
|
||||
$script:CloudEnv = 'Com'
|
||||
$script:AwsCloudResource = 'arn:aws'
|
||||
$script:AwsCloudResource = 'arn:aws'
|
||||
|
||||
#ComToFFX
|
||||
#$script:SentinelClientId = 'api://d4230588-5f84-4281-a9c7-2c15194b28f7'
|
||||
#$script:SentinelTenantId = 'cab8a31a-1906-4287-a0d8-4eef66b95f6e'
|
||||
#$script:CloudEnv = 'Com'
|
||||
#$script:AwsCloudResource = 'arn:aws'
|
|
@ -137,11 +137,14 @@ function New-S3Bucket
|
|||
|
||||
Write-Log -Message "Executing: aws s3api head-bucket --bucket $bucketName 2>&1" -LogFileName $LogFileName -Severity Verbose
|
||||
$headBucketOutput = aws s3api head-bucket --bucket $bucketName 2>&1
|
||||
# If there was an error the bucket does not already exist or no permissions.
|
||||
Write-Log -Message "output $headBucketOutput 2>&1" -LogFileName $LogFileName -Severity Verbose
|
||||
Write-Log -Message "error code $lastexitcode 2>&1" -LogFileName $LogFileName -Severity Verbose
|
||||
|
||||
$isBucketNotExist = $null -ne $headBucketOutput
|
||||
$isBucketNotExist = $lastexitcode -ne 0
|
||||
if ($isBucketNotExist)
|
||||
{
|
||||
$bucketCreationConfirm = Read-ValidatedHost -Prompt "Bucket doesn't exist, would you like to create a new bucket ? [y/n]" -ValidationType Confirm
|
||||
$bucketCreationConfirm = Read-ValidatedHost -Prompt "Bucket doesn't exist or you don't have permission to access it, would you like to create a new bucket ? [y/n]" -ValidationType Confirm
|
||||
Write-Log -Message "Creating new bucket: $bucketCreationConfirm " -LogFileName $LogFileName -Indent 2
|
||||
|
||||
if ($bucketCreationConfirm -eq 'y')
|
||||
|
|
Загрузка…
Ссылка в новой задаче