Merge branch 'main' into remove_aws_from_provider_install
commit
9f93dcee2a
|
@ -127,6 +127,16 @@
|
|||
"contributions": [
|
||||
"tool"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "lotoussa",
|
||||
"name": "Toussaint Louis",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/66522867?v=4",
|
||||
"profile": "http://louistoussaint.fr",
|
||||
"contributions": [
|
||||
"code",
|
||||
"doc"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ jobs:
|
|||
${DISCORD_WEBHOOK}
|
||||
- store_test_results:
|
||||
path: ./
|
||||
test:
|
||||
lint:
|
||||
docker:
|
||||
- image: golang:1.15
|
||||
steps:
|
||||
|
@ -68,6 +68,13 @@ jobs:
|
|||
exit 1
|
||||
fi
|
||||
- run: make install-tools
|
||||
- run: make lint
|
||||
test:
|
||||
docker:
|
||||
- image: golang:1.15
|
||||
steps:
|
||||
- checkout
|
||||
- run: make install-tools
|
||||
- run: make test
|
||||
- run:
|
||||
name: Codecov upload
|
||||
|
@ -148,6 +155,11 @@ workflows:
|
|||
- main
|
||||
pullrequest:
|
||||
jobs:
|
||||
- lint:
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- main
|
||||
- test:
|
||||
filters:
|
||||
branches:
|
||||
|
@ -168,6 +180,12 @@ workflows:
|
|||
only: /^v.*/
|
||||
branches:
|
||||
ignore: /.*/
|
||||
- lint:
|
||||
filters:
|
||||
tags:
|
||||
only: /^v.*/
|
||||
branches:
|
||||
ignore: /.*/
|
||||
- test:
|
||||
filters:
|
||||
tags:
|
||||
|
@ -186,6 +204,7 @@ workflows:
|
|||
- release:
|
||||
context: driftctl
|
||||
requires:
|
||||
- lint
|
||||
- test
|
||||
- sign_release
|
||||
filters:
|
||||
|
|
|
@ -19,6 +19,7 @@ Thank you to all the people who have already contributed to driftctl.
|
|||
<tr>
|
||||
<td align="center"><a href="https://github.com/sfenman"><img src="https://avatars.githubusercontent.com/u/43748066?v=4?s=80" width="80px;" alt=""/><br /><sub><b>sfenman</b></sub></a><br /><a href="https://github.com/cloudskiff/driftctl/commits?author=sfenman" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/herbygillot"><img src="https://avatars.githubusercontent.com/u/618376?v=4?s=80" width="80px;" alt=""/><br /><sub><b>Herby Gillot</b></sub></a><br /><a href="#tool-herbygillot" title="Tools">🔧</a></td>
|
||||
<td align="center"><a href="http://louistoussaint.fr"><img src="https://avatars.githubusercontent.com/u/66522867?v=4?s=80" width="80px;" alt=""/><br /><sub><b>Toussaint Louis</b></sub></a><br /><a href="https://github.com/cloudskiff/driftctl/commits?author=lotoussa" title="Code">💻</a> <a href="https://github.com/cloudskiff/driftctl/commits?author=lotoussa" title="Documentation">📖</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
|
4
Makefile
4
Makefile
|
@ -25,7 +25,7 @@ release:
|
|||
ENV=release scripts/build.sh
|
||||
|
||||
.PHONY: test
|
||||
test: deps lint
|
||||
test: deps
|
||||
$(GOTEST) --format testname --junitfile unit-tests.xml -- -coverprofile=cover.out -coverpkg=.,./pkg/... ./...
|
||||
|
||||
.PHONY: coverage
|
||||
|
@ -54,7 +54,7 @@ clean:
|
|||
.PHONY: lint
|
||||
lint:
|
||||
@which golangci-lint > /dev/null 2>&1 || (curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | bash -s -- -b $(GOBINPATH) v1.31.0)
|
||||
golangci-lint run --timeout=2m
|
||||
golangci-lint run -v --timeout=4m
|
||||
|
||||
.PHONY: deps
|
||||
deps:
|
||||
|
|
10
README.md
10
README.md
|
@ -154,9 +154,9 @@ Our key can be retrieved from common keyservers.
|
|||
|
||||
```shell
|
||||
# Download binary, checksums and signature
|
||||
curl https://github.com/cloudskiff/driftctl/releases/latest/download/driftctl_linux_amd64 -o driftctl_linux_amd64
|
||||
curl https://github.com/cloudskiff/driftctl/releases/latest/download/driftctl_SHA256SUMS -o driftctl_SHA256SUMS
|
||||
curl https://github.com/cloudskiff/driftctl/releases/latest/download/driftctl_SHA256SUMS.gpg -o driftctl_SHA256SUMS.gpg
|
||||
$ curl -L https://github.com/cloudskiff/driftctl/releases/latest/download/driftctl_linux_amd64 -o driftctl_linux_amd64
|
||||
$ curl -L https://github.com/cloudskiff/driftctl/releases/latest/download/driftctl_SHA256SUMS -o driftctl_SHA256SUMS
|
||||
$ curl -L https://github.com/cloudskiff/driftctl/releases/latest/download/driftctl_SHA256SUMS.gpg -o driftctl_SHA256SUMS.gpg
|
||||
|
||||
# Import key
|
||||
$ gpg --keyserver hkps.pool.sks-keyservers.net --recv-keys 0xACC776A79C824EBD
|
||||
|
@ -164,8 +164,8 @@ gpg: key ACC776A79C824EBD: public key "Cloudskiff <security@cloudskiff.com>" imp
|
|||
gpg: Total number processed: 1
|
||||
gpg: imported: 1
|
||||
|
||||
# Verify signature (eventually trust the key from gnupg to avoid any warning)
|
||||
$ gpg --verify bin/driftctl_SHA256SUMS.gpg
|
||||
# Verify signature (optionally trust the key from gnupg to avoid any warning)
|
||||
$ gpg --verify driftctl_SHA256SUMS.gpg
|
||||
gpg: Signature made jeu. 04 févr. 2021 14:58:06 CET
|
||||
gpg: using EDDSA key 277666005A7F01D484F6376DACC776A79C824EBD
|
||||
gpg: issuer "security@cloudskiff.com"
|
||||
|
|
|
@ -2,70 +2,70 @@
|
|||
{
|
||||
"ApplicationFailureFeedbackRoleArn": "",
|
||||
"ApplicationSuccessFeedbackRoleArn": "",
|
||||
"ApplicationSuccessFeedbackSampleRate": null,
|
||||
"ApplicationSuccessFeedbackSampleRate": 0,
|
||||
"Arn": "arn:aws:sns:eu-west-3:526954929923:user-updates-topic",
|
||||
"DeliveryPolicy": "{\"http\":{\"defaultHealthyRetryPolicy\":{\"minDelayTarget\":20,\"maxDelayTarget\":20,\"numRetries\":3,\"numMaxDelayRetries\":0,\"numNoDelayRetries\":0,\"numMinDelayRetries\":0,\"backoffFunction\":\"linear\"},\"disableSubscriptionOverrides\":false,\"defaultThrottlePolicy\":{\"maxReceivesPerSecond\":1}}}",
|
||||
"DisplayName": "",
|
||||
"HttpFailureFeedbackRoleArn": "",
|
||||
"HttpSuccessFeedbackRoleArn": "",
|
||||
"HttpSuccessFeedbackSampleRate": null,
|
||||
"HttpSuccessFeedbackSampleRate": 0,
|
||||
"Id": "arn:aws:sns:eu-west-3:526954929923:user-updates-topic",
|
||||
"KmsMasterKeyId": "",
|
||||
"LambdaFailureFeedbackRoleArn": "",
|
||||
"LambdaSuccessFeedbackRoleArn": "",
|
||||
"LambdaSuccessFeedbackSampleRate": null,
|
||||
"LambdaSuccessFeedbackSampleRate": 0,
|
||||
"Name": "user-updates-topic",
|
||||
"NamePrefix": null,
|
||||
"Policy": "{\"Version\":\"2008-10-17\",\"Id\":\"__default_policy_ID\",\"Statement\":[{\"Sid\":\"__default_statement_ID\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"*\"},\"Action\":[\"SNS:GetTopicAttributes\",\"SNS:SetTopicAttributes\",\"SNS:AddPermission\",\"SNS:RemovePermission\",\"SNS:DeleteTopic\",\"SNS:Subscribe\",\"SNS:ListSubscriptionsByTopic\",\"SNS:Publish\",\"SNS:Receive\"],\"Resource\":\"arn:aws:sns:eu-west-3:526954929923:user-updates-topic\",\"Condition\":{\"StringEquals\":{\"AWS:SourceOwner\":\"526954929923\"}}}]}",
|
||||
"SqsFailureFeedbackRoleArn": "",
|
||||
"SqsSuccessFeedbackRoleArn": "",
|
||||
"SqsSuccessFeedbackSampleRate": null,
|
||||
"SqsSuccessFeedbackSampleRate": 0,
|
||||
"Tags": {}
|
||||
},
|
||||
{
|
||||
"ApplicationFailureFeedbackRoleArn": "",
|
||||
"ApplicationSuccessFeedbackRoleArn": "",
|
||||
"ApplicationSuccessFeedbackSampleRate": null,
|
||||
"ApplicationSuccessFeedbackSampleRate": 0,
|
||||
"Arn": "arn:aws:sns:eu-west-3:526954929923:user-updates-topic2",
|
||||
"DeliveryPolicy": "{\"http\":{\"defaultHealthyRetryPolicy\":{\"minDelayTarget\":20,\"maxDelayTarget\":20,\"numRetries\":3,\"numMaxDelayRetries\":0,\"numNoDelayRetries\":0,\"numMinDelayRetries\":0,\"backoffFunction\":\"linear\"},\"disableSubscriptionOverrides\":false,\"defaultThrottlePolicy\":{\"maxReceivesPerSecond\":1}}}",
|
||||
"DisplayName": "",
|
||||
"HttpFailureFeedbackRoleArn": "",
|
||||
"HttpSuccessFeedbackRoleArn": "",
|
||||
"HttpSuccessFeedbackSampleRate": null,
|
||||
"HttpSuccessFeedbackSampleRate": 0,
|
||||
"Id": "arn:aws:sns:eu-west-3:526954929923:user-updates-topic2",
|
||||
"KmsMasterKeyId": "",
|
||||
"LambdaFailureFeedbackRoleArn": "",
|
||||
"LambdaSuccessFeedbackRoleArn": "",
|
||||
"LambdaSuccessFeedbackSampleRate": null,
|
||||
"LambdaSuccessFeedbackSampleRate": 0,
|
||||
"Name": "user-updates-topic2",
|
||||
"NamePrefix": null,
|
||||
"Policy": "{\"Version\":\"2008-10-17\",\"Id\":\"__default_policy_ID\",\"Statement\":[{\"Sid\":\"__default_statement_ID\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"*\"},\"Action\":[\"SNS:GetTopicAttributes\",\"SNS:SetTopicAttributes\",\"SNS:AddPermission\",\"SNS:RemovePermission\",\"SNS:DeleteTopic\",\"SNS:Subscribe\",\"SNS:ListSubscriptionsByTopic\",\"SNS:Publish\",\"SNS:Receive\"],\"Resource\":\"arn:aws:sns:eu-west-3:526954929923:user-updates-topic2\",\"Condition\":{\"StringEquals\":{\"AWS:SourceOwner\":\"526954929923\"}}}]}",
|
||||
"SqsFailureFeedbackRoleArn": "",
|
||||
"SqsSuccessFeedbackRoleArn": "",
|
||||
"SqsSuccessFeedbackSampleRate": null,
|
||||
"SqsSuccessFeedbackSampleRate": 0,
|
||||
"Tags": {}
|
||||
},
|
||||
{
|
||||
"ApplicationFailureFeedbackRoleArn": "",
|
||||
"ApplicationSuccessFeedbackRoleArn": "",
|
||||
"ApplicationSuccessFeedbackSampleRate": null,
|
||||
"ApplicationSuccessFeedbackSampleRate": 0,
|
||||
"Arn": "arn:aws:sns:eu-west-3:526954929923:user-updates-topic3",
|
||||
"DeliveryPolicy": "",
|
||||
"DisplayName": "",
|
||||
"HttpFailureFeedbackRoleArn": "",
|
||||
"HttpSuccessFeedbackRoleArn": "",
|
||||
"HttpSuccessFeedbackSampleRate": null,
|
||||
"HttpSuccessFeedbackSampleRate": 0,
|
||||
"Id": "arn:aws:sns:eu-west-3:526954929923:user-updates-topic3",
|
||||
"KmsMasterKeyId": "",
|
||||
"LambdaFailureFeedbackRoleArn": "",
|
||||
"LambdaSuccessFeedbackRoleArn": "",
|
||||
"LambdaSuccessFeedbackSampleRate": null,
|
||||
"LambdaSuccessFeedbackSampleRate": 0,
|
||||
"Name": "user-updates-topic3",
|
||||
"NamePrefix": null,
|
||||
"Policy": "{\"Version\":\"2008-10-17\",\"Id\":\"__default_policy_ID\",\"Statement\":[{\"Sid\":\"__default_statement_ID\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"*\"},\"Action\":[\"SNS:GetTopicAttributes\",\"SNS:SetTopicAttributes\",\"SNS:AddPermission\",\"SNS:RemovePermission\",\"SNS:DeleteTopic\",\"SNS:Subscribe\",\"SNS:ListSubscriptionsByTopic\",\"SNS:Publish\",\"SNS:Receive\"],\"Resource\":\"arn:aws:sns:eu-west-3:526954929923:user-updates-topic3\",\"Condition\":{\"StringEquals\":{\"AWS:SourceOwner\":\"526954929923\"}}}]}",
|
||||
"SqsFailureFeedbackRoleArn": "",
|
||||
"SqsSuccessFeedbackRoleArn": "",
|
||||
"SqsSuccessFeedbackSampleRate": null,
|
||||
"SqsSuccessFeedbackSampleRate": 0,
|
||||
"Tags": {}
|
||||
}
|
||||
]
|
|
@ -8,7 +8,7 @@ type AwsSnsTopic struct {
|
|||
ApplicationSuccessFeedbackRoleArn *string `cty:"application_success_feedback_role_arn"`
|
||||
ApplicationSuccessFeedbackSampleRate *int `cty:"application_success_feedback_sample_rate"`
|
||||
Arn *string `cty:"arn" computed:"true"`
|
||||
DeliveryPolicy *string `cty:"delivery_policy"`
|
||||
DeliveryPolicy *string `cty:"delivery_policy" jsonstring:"true"`
|
||||
DisplayName *string `cty:"display_name"`
|
||||
HttpFailureFeedbackRoleArn *string `cty:"http_failure_feedback_role_arn"`
|
||||
HttpSuccessFeedbackRoleArn *string `cty:"http_success_feedback_role_arn"`
|
||||
|
@ -20,7 +20,7 @@ type AwsSnsTopic struct {
|
|||
LambdaSuccessFeedbackSampleRate *int `cty:"lambda_success_feedback_sample_rate"`
|
||||
Name *string `cty:"name" computed:"true"`
|
||||
NamePrefix *string `cty:"name_prefix"`
|
||||
Policy *string `cty:"policy" computed:"true"`
|
||||
Policy *string `cty:"policy" computed:"true" jsonstring:"true"`
|
||||
SqsFailureFeedbackRoleArn *string `cty:"sqs_failure_feedback_role_arn"`
|
||||
SqsSuccessFeedbackRoleArn *string `cty:"sqs_success_feedback_role_arn"`
|
||||
SqsSuccessFeedbackSampleRate *int `cty:"sqs_success_feedback_sample_rate"`
|
||||
|
|
|
@ -3,6 +3,7 @@ package aws
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/cloudskiff/driftctl/pkg/resource"
|
||||
)
|
||||
|
||||
|
@ -10,14 +11,31 @@ func (r *AwsSnsTopic) NormalizeForState() (resource.Resource, error) {
|
|||
if r.Policy != nil && *r.Policy == "" {
|
||||
r.Policy = nil
|
||||
}
|
||||
r.normalizeDefaultFields()
|
||||
return r, nil
|
||||
}
|
||||
|
||||
func (r *AwsSnsTopic) NormalizeForProvider() (resource.Resource, error) {
|
||||
r.Policy = nil
|
||||
r.normalizeDefaultFields()
|
||||
return r, nil
|
||||
}
|
||||
|
||||
func (r *AwsSnsTopic) normalizeDefaultFields() {
|
||||
if r.SqsSuccessFeedbackSampleRate == nil {
|
||||
r.SqsSuccessFeedbackSampleRate = aws.Int(0)
|
||||
}
|
||||
if r.LambdaSuccessFeedbackSampleRate == nil {
|
||||
r.LambdaSuccessFeedbackSampleRate = aws.Int(0)
|
||||
}
|
||||
if r.HttpSuccessFeedbackSampleRate == nil {
|
||||
r.HttpSuccessFeedbackSampleRate = aws.Int(0)
|
||||
}
|
||||
if r.ApplicationSuccessFeedbackSampleRate == nil {
|
||||
r.ApplicationSuccessFeedbackSampleRate = aws.Int(0)
|
||||
}
|
||||
}
|
||||
|
||||
func (r *AwsSnsTopic) String() string {
|
||||
if r.DisplayName != nil && *r.DisplayName != "" && r.Name != nil && *r.Name != "" {
|
||||
return fmt.Sprintf("%s (%s)", *r.DisplayName, *r.Name)
|
||||
|
|
|
@ -6,7 +6,7 @@ const AwsSnsTopicPolicyResourceType = "aws_sns_topic_policy"
|
|||
type AwsSnsTopicPolicy struct {
|
||||
Arn *string `cty:"arn"`
|
||||
Id string `cty:"id" computed:"true"`
|
||||
Policy *string `cty:"policy"`
|
||||
Policy *string `cty:"policy" jsonstring:"true"`
|
||||
}
|
||||
|
||||
func (r *AwsSnsTopicPolicy) TerraformId() string {
|
||||
|
|
|
@ -5,7 +5,7 @@ const AwsSqsQueuePolicyResourceType = "aws_sqs_queue_policy"
|
|||
|
||||
type AwsSqsQueuePolicy struct {
|
||||
Id string `cty:"id" computed:"true"`
|
||||
Policy *string `cty:"policy"`
|
||||
Policy *string `cty:"policy" jsonstring:"true"`
|
||||
QueueUrl *string `cty:"queue_url"`
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue