Skip to content

Commit

Permalink
feat(s3control): Add S3 AccessPoint and AccessPointPolicy
Browse files Browse the repository at this point in the history
Signed-off-by: kbujanecki-dt <krzysztof.bujanecki@dynatrace.com>
  • Loading branch information
kbujanecki-dt committed Jul 31, 2023
1 parent 6325483 commit c8e9f65
Show file tree
Hide file tree
Showing 25 changed files with 4,104 additions and 44 deletions.
2 changes: 2 additions & 0 deletions apis/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ import (
route53resolverv1alpha1 "github.com/crossplane-contrib/provider-aws/apis/route53resolver/v1alpha1"
s3v1alpha2 "github.com/crossplane-contrib/provider-aws/apis/s3/v1alpha3"
s3v1beta1 "github.com/crossplane-contrib/provider-aws/apis/s3/v1beta1"
s3control "github.com/crossplane-contrib/provider-aws/apis/s3control/v1alpha1"
secretsmanagerv1alpha1 "github.com/crossplane-contrib/provider-aws/apis/secretsmanager/v1alpha1"
secretsmanagerv1beta1 "github.com/crossplane-contrib/provider-aws/apis/secretsmanager/v1beta1"
servicediscoveryv1alpha1 "github.com/crossplane-contrib/provider-aws/apis/servicediscovery/v1alpha1"
Expand Down Expand Up @@ -165,6 +166,7 @@ func init() {
batchmanualv1alpha1.SchemeBuilder.AddToScheme,
emrcontainersv1alpah1.SchemeBuilder.AddToScheme,
autoscalingv1beta1.SchemeBuilder.AddToScheme,
s3control.SchemeBuilder.AddToScheme,
)
}

Expand Down
15 changes: 15 additions & 0 deletions apis/s3control/generator-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ignore:
resource_names:
- AccessPointForObjectLambda
- Bucket
- Job
- MultiRegionAccessPoint
field_paths:
- CreateAccessPointInput.Name
- CreateAccessPointInput.Bucket
resources:
AccessPoint:
exceptions:
errors:
404:
code: NoSuchAccessPoint
46 changes: 46 additions & 0 deletions apis/s3control/v1alpha1/custom_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
Copyright 2021 The Crossplane Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1

import (
xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"

"github.com/crossplane-contrib/provider-aws/apis/s3/common"
)

// CustomAccessPointParameters includes the custom fields of Stage.
type CustomAccessPointParameters struct {
// BucketName is the name of the Bucket for AccessPoint
// +immutable
// +crossplane:generate:reference:type=github.com/crossplane-contrib/provider-aws/apis/s3/v1beta1.Bucket
BucketName *string `json:"bucketName,omitempty"`

// BucketNameRef is a reference to a Bucket used to set the BucketName
// +optional
BucketNameRef *xpv1.Reference `json:"bucketNameRef,omitempty"`

// BucketNameSelector selects a references to used to set the BucketName
// +optional
BucketNameSelector *xpv1.Selector `json:"bucketNameSelector,omitempty"`

// The policy that you want to apply to the specified access point. For more
// information about access point policies, see Managing data access with Amazon
// S3 access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html)
// in the Amazon S3 User Guide.
// +optional
Policy *common.BucketPolicyBody `json:"policy"`
}
108 changes: 108 additions & 0 deletions apis/s3control/v1alpha1/zz_access_point.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions apis/s3control/v1alpha1/zz_doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c8e9f65

Please sign in to comment.