@@ -566,3 +566,150 @@ export interface CreateBucketOptions {
566
566
/** Allows grantee to write the ACL for the applicable bucket. */
567
567
grantWriteAcp ?: string ;
568
568
}
569
+
570
+ /**
571
+ * @see https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html
572
+ */
573
+ export interface Statement {
574
+ /**
575
+ * You can provide an optional identifier, Sid (statement ID) for the policy statement.
576
+ *
577
+ * @see https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_sid.html
578
+ */
579
+ sid ?: string ;
580
+
581
+ /**
582
+ * The Effect element is required and specifies whether the statement results
583
+ * an allow or an explicit deny.
584
+ *
585
+ * @see https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_effect.html
586
+ */
587
+ effect : "Allow" | "Deny" ;
588
+
589
+ /**
590
+ * The account or user who is allowed access to the actions and resources in
591
+ * the statement. In a bucket policy, the principal is the user, account,
592
+ * service, or other entity that is the recipient of this permission.
593
+ *
594
+ * @see https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html
595
+ */
596
+ principal ?: string | Record < string , string | Array < string > > ;
597
+
598
+ /**
599
+ * Use the NotPrincipal element to specify the IAM user, federated user,
600
+ * IAM role, AWS account, AWS service, or other principal that is not allowed
601
+ * or denied access to a resource.
602
+ *
603
+ * @see https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_notprincipal.html
604
+ */
605
+ notPrincipal ?: string | Record < string , string | Array < string > > ;
606
+
607
+ /**
608
+ * The Action element describes the specific action or actions that will be
609
+ * allowed or denied. Statements must include either an Action or NotAction
610
+ * element.
611
+ *
612
+ * @see https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_action.html
613
+ */
614
+ action ?: string | Array < string > ;
615
+
616
+ /**
617
+ * NotAction is an advanced policy element that explicitly matches everything
618
+ * except the specified list of actions. Using NotAction can result in a
619
+ * shorter policy by listing only a few actions that should not match, rather
620
+ * than including a long list of actions that will match.
621
+ *
622
+ * @see https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_notaction.html
623
+ */
624
+ notAction ?: string | Array < string > ;
625
+
626
+ /**
627
+ * The Resource element specifies the object or objects that the statement covers.
628
+ * Statements must include either a Resource or a NotResource element.
629
+ *
630
+ * @see https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_resource.html
631
+ */
632
+ resource ?: string | Array < string > ;
633
+
634
+ /**
635
+ * NotResource is an advanced policy element that explicitly matches every
636
+ * resource except those specified. Using NotResource can result in a shorter
637
+ * policy by listing only a few resources that should not match, rather than
638
+ * including a long list of resources that will match.
639
+ *
640
+ * @see https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_notresource.html
641
+ */
642
+ notResource ?: string | Array < string > ;
643
+
644
+ /**
645
+ * The Condition element (or Condition block) lets you specify conditions for
646
+ * when a policy is in effect.
647
+ *
648
+ * @see https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html
649
+ */
650
+ condition ?: Record < string , Record < string , string | Array < string > > > ;
651
+ }
652
+
653
+ /**
654
+ * @see https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html
655
+ */
656
+ export interface Policy {
657
+ /**
658
+ * The Version policy element specifies the language syntax rules that are to
659
+ * be used to process a policy.
660
+ *
661
+ * @see https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_version.html
662
+ */
663
+ version ?: "2012-10-17" | "2008-10-17" ;
664
+
665
+ /**
666
+ * The id element specifies an optional identifier for the policy. The ID is
667
+ * used differently in different services.
668
+ *
669
+ * @see https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_id.html
670
+ */
671
+ id ?: string ;
672
+
673
+ /**
674
+ * The policy statement(s).
675
+ *
676
+ * @see https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_statement.html
677
+ */
678
+ statement : Statement | Array < Statement > ;
679
+ }
680
+
681
+ export interface PutBucketPolicyOptions {
682
+ /**
683
+ * Set this parameter to true to confirm that you want to remove your
684
+ * permissions to change this bucket policy in the future.
685
+ */
686
+ confirmRemoveSelfBucketAccess ?: boolean ;
687
+
688
+ /**
689
+ * The account ID of the expected bucket owner. If the bucket is owned by a
690
+ * different account, the request will fail with an HTTP 403 (Access Denied)
691
+ * error.
692
+ */
693
+ expectedBucketOwner ?: string ;
694
+
695
+ /** The bucket policy. */
696
+ policy : Policy ;
697
+ }
698
+
699
+ export interface GetBucketPolicyOptions {
700
+ /**
701
+ * The account ID of the expected bucket owner. If the bucket is owned by a
702
+ * different account, the request will fail with an HTTP 403 (Access Denied)
703
+ * error.
704
+ */
705
+ expectedBucketOwner ?: string ;
706
+ }
707
+
708
+ export interface DeleteBucketPolicyOptions {
709
+ /**
710
+ * The account ID of the expected bucket owner. If the bucket is owned by a
711
+ * different account, the request will fail with an HTTP 403 (Access Denied)
712
+ * error.
713
+ */
714
+ expectedBucketOwner ?: string ;
715
+ }
0 commit comments